diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml index dbd1cf4..0016e2f 100644 --- a/.github/workflows/dotnet.yaml +++ b/.github/workflows/dotnet.yaml @@ -200,6 +200,11 @@ jobs: with: name: nuget-package-interfacemock path: Plugins/InterfaceMock/WoofWare.Whippet.Plugin.InterfaceMock/bin/Release/WoofWare.Whippet.Plugin.InterfaceMock.*.nupkg + - name: Upload NuGet artifact (swagger plugin) + uses: actions/upload-artifact@v4 + with: + name: nuget-package-swagger + path: Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/bin/Release/WoofWare.Whippet.Plugin.Swagger.*.nupkg expected-pack: needs: [nuget-pack] @@ -293,6 +298,14 @@ jobs: - name: Check NuGet contents # Verify that there is exactly one nupkg in the artifact that would be NuGet published run: if [[ $(find packed-interfacemock -maxdepth 1 -name 'WoofWare.Whippet.Plugin.InterfaceMock.*.nupkg' -printf c | wc -c) -ne "1" ]]; then exit 1; fi + - name: Download NuGet artifact (swagger plugin) + uses: actions/download-artifact@v4 + with: + name: nuget-package-swagger + path: packed-swagger + - name: Check NuGet contents + # Verify that there is exactly one nupkg in the artifact that would be NuGet published + run: if [[ $(find packed-swagger -maxdepth 1 -name 'WoofWare.Whippet.Plugin.Swagger.*.nupkg' -printf c | wc -c) -ne "1" ]]; then exit 1; fi check-accurate-generations: runs-on: ubuntu-latest @@ -657,3 +670,36 @@ jobs: nuget-key: ${{ secrets.NUGET_API_KEY }} nupkg-dir: packed/ dotnet: ${{ steps.dotnet-identify.outputs.dotnet }} + + nuget-publish-swagger-plugin: + runs-on: ubuntu-latest + if: ${{ !github.event.repository.fork && github.ref == 'refs/heads/main' }} + needs: [all-required-checks-complete] + environment: main-deploy + permissions: + id-token: write + attestations: write + contents: read + steps: + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v29 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Download NuGet artifact + uses: actions/download-artifact@v4 + with: + name: nuget-package-swagger + path: packed + - name: Identify `dotnet` + id: dotnet-identify + run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT' + - name: Publish to NuGet + id: publish-success + uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059 + with: + package-name: WoofWare.Whippet.Plugin.Swagger + nuget-key: ${{ secrets.NUGET_API_KEY }} + nupkg-dir: packed/ + dotnet: ${{ steps.dotnet-identify.outputs.dotnet }} diff --git a/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/DesiredGenerator.fs b/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/DesiredGenerator.fs index e95eb98..7dd5c6f 100644 --- a/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/DesiredGenerator.fs +++ b/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/DesiredGenerator.fs @@ -5,7 +5,7 @@ type internal DesiredGenerator = static member Parse (s : string) = match s with - | "HttpClient" -> DesiredGenerator.HttpClient None - | "HttpClient(true)" -> DesiredGenerator.HttpClient (Some true) - | "HttpClient(false)" -> DesiredGenerator.HttpClient (Some false) - | _ -> failwith $"Failed to parse as a generator specification: %s{s}" + | "HttpClient" -> DesiredGenerator.HttpClient None |> Some + | "HttpClient(true)" -> DesiredGenerator.HttpClient (Some true) |> Some + | "HttpClient(false)" -> DesiredGenerator.HttpClient (Some false) |> Some + | _ -> None diff --git a/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/HttpClientGenerator.fs b/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/HttpClientGenerator.fs index 805ea26..09bc7a6 100644 --- a/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/HttpClientGenerator.fs +++ b/Plugins/HttpClient/WoofWare.Whippet.Plugin.HttpClient/HttpClientGenerator.fs @@ -968,7 +968,7 @@ type HttpClientGenerator () = desired |> List.tryPick (fun generator -> match generator with - | DesiredGenerator.HttpClient arg -> + | Some (DesiredGenerator.HttpClient arg) -> let spec = { ExtensionMethods = @@ -978,6 +978,7 @@ type HttpClientGenerator () = } Some (typeDef, spec) + | None -> None ) | _ -> None | Some attr -> diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGitea.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGitea.fs new file mode 100644 index 0000000..873fc76 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGitea.fs @@ -0,0 +1,6422 @@ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// APIError is an api error with a message +[] +type APIError = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Message : string option + [] + Url : string option + } + +/// AccessToken represents an API access token. +[] +type AccessToken = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Id : int option + [] + Name : string option + [] + Scopes : string list option + [] + Sha1 : string option + [] + TokenLastEight : string option + } + +/// ActivityPub type +[] +type ActivityPub = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Context : string option + } + +/// AddCollaboratorOption options when adding a user as a collaborator of a repository +[] +type AddCollaboratorOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Permission : string option + } + +/// AddTimeOption options for adding time to an issue +[] +type AddTimeOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Created : string option + [] + Time : int + [] + UserName : string option + } + +/// AnnotatedTagObject contains meta information of the tag object +[] +type AnnotatedTagObject = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Sha : string option + [] + Type : string option + [] + Url : string option + } + +/// Attachment a generic attachment +[] +type Attachment = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + BrowserDownloadUrl : string option + [] + CreatedAt : string option + [] + DownloadCount : int option + [] + Id : int option + [] + Name : string option + [] + Size : int option + [] + Uuid : string option + } + +/// BranchProtection represents a branch protection for a repository +[] +type BranchProtection = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ApprovalsWhitelistTeams : string list option + [] + ApprovalsWhitelistUsername : string list option + [] + BlockOnOfficialReviewRequests : bool option + [] + BlockOnOutdatedBranch : bool option + [] + BlockOnRejectedReviews : bool option + [] + BranchName : string option + [] + CreatedAt : string option + [] + DismissStaleApprovals : bool option + [] + EnableApprovalsWhitelist : bool option + [] + EnableMergeWhitelist : bool option + [] + EnablePush : bool option + [] + EnablePushWhitelist : bool option + [] + EnableStatusCheck : bool option + [] + MergeWhitelistTeams : string list option + [] + MergeWhitelistUsernames : string list option + [] + ProtectedFilePatterns : string option + [] + PushWhitelistDeployKeys : bool option + [] + PushWhitelistTeams : string list option + [] + PushWhitelistUsernames : string list option + [] + RequireSignedCommits : bool option + [] + RequiredApprovals : int option + [] + RuleName : string option + [] + StatusCheckContexts : string list option + [] + UnprotectedFilePatterns : string option + [] + UpdatedAt : string option + } + +/// ChangedFile store information about files affected by the pull request +[] +type ChangedFile = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Additions : int option + [] + Changes : int option + [] + ContentsUrl : string option + [] + Deletions : int option + [] + Filename : string option + [] + HtmlUrl : string option + [] + PreviousFilename : string option + [] + RawUrl : string option + [] + Status : string option + } + +/// CommitAffectedFiles store information about files affected by the commit +[] +type CommitAffectedFiles = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Filename : string option + } + +/// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE +[] +type CommitDateOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : string option + [] + Committer : string option + } + +/// CommitMeta contains meta information of a commit in terms of API. +[] +type CommitMeta = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Created : string option + [] + Sha : string option + [] + Url : string option + } + +/// CommitStats is statistics for a RepoCommit +[] +type CommitStats = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Additions : int option + [] + Deletions : int option + [] + Total : int option + } + +/// CommitUser contains information of a user in the context of a commit. +[] +type CommitUser = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Date : string option + [] + Email : string option + [] + Name : string option + } + +/// CreateAccessTokenOption options when create access token +[] +type CreateAccessTokenOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Name : string + [] + Scopes : string list option + } + +/// CreateBranchProtectionOption options for creating a branch protection +[] +type CreateBranchProtectionOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ApprovalsWhitelistTeams : string list option + [] + ApprovalsWhitelistUsername : string list option + [] + BlockOnOfficialReviewRequests : bool option + [] + BlockOnOutdatedBranch : bool option + [] + BlockOnRejectedReviews : bool option + [] + BranchName : string option + [] + DismissStaleApprovals : bool option + [] + EnableApprovalsWhitelist : bool option + [] + EnableMergeWhitelist : bool option + [] + EnablePush : bool option + [] + EnablePushWhitelist : bool option + [] + EnableStatusCheck : bool option + [] + MergeWhitelistTeams : string list option + [] + MergeWhitelistUsernames : string list option + [] + ProtectedFilePatterns : string option + [] + PushWhitelistDeployKeys : bool option + [] + PushWhitelistTeams : string list option + [] + PushWhitelistUsernames : string list option + [] + RequireSignedCommits : bool option + [] + RequiredApprovals : int option + [] + RuleName : string option + [] + StatusCheckContexts : string list option + [] + UnprotectedFilePatterns : string option + } + +/// CreateBranchRepoOption options when creating a branch in a repository +[] +type CreateBranchRepoOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + NewBranchName : string + [] + OldBranchName : string option + } + +/// CreateEmailOption options when creating email addresses +[] +type CreateEmailOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Emails : string list option + } + +/// CreateForkOption options for creating a fork +[] +type CreateForkOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Name : string option + [] + Organization : string option + } + +/// CreateGPGKeyOption options create user GPG key +[] +type CreateGPGKeyOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ArmoredPublicKey : string + [] + ArmoredSignature : string option + } + +/// CreateHookOptionConfig has all config options in it +/// required are "content_type" and "url" Required +[] +type CreateHookOptionConfig = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// CreateIssueCommentOption options for creating a comment on an issue +[] +type CreateIssueCommentOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string + } + +/// CreateIssueOption options to create one issue +[] +type CreateIssueOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assignee : string option + [] + Assignees : string list option + [] + Body : string option + [] + Closed : bool option + [] + DueDate : string option + [] + Labels : int list option + [] + Milestone : int option + [] + Ref : string option + [] + Title : string + } + +/// CreateKeyOption options when creating a key +[] +type CreateKeyOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Key : string + [] + ReadOnly : bool option + [] + Title : string + } + +/// CreateLabelOption options for creating a label +[] +type CreateLabelOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Color : string + [] + Description : string option + [] + Exclusive : bool option + [] + Name : string + } + +/// CreateMilestoneOption options for creating a milestone +[] +type CreateMilestoneOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Description : string option + [] + DueOn : string option + [] + State : string option + [] + Title : string option + } + +/// CreateOAuth2ApplicationOptions holds options to create an oauth2 application +[] +type CreateOAuth2ApplicationOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ConfidentialClient : bool option + [] + Name : string option + [] + RedirectUris : string list option + } + +/// CreateOrgOption options for creating an organization +[] +type CreateOrgOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Description : string option + [] + FullName : string option + [] + Location : string option + [] + RepoAdminChangeTeamAccess : bool option + [] + Username : string + [] + Visibility : string option + [] + Website : string option + } + +/// CreatePullRequestOption options when creating a pull request +[] +type CreatePullRequestOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assignee : string option + [] + Assignees : string list option + [] + Base : string option + [] + Body : string option + [] + DueDate : string option + [] + Head : string option + [] + Labels : int list option + [] + Milestone : int option + [] + Title : string option + } + +/// CreatePullReviewComment represent a review comment for creation api +[] +type CreatePullReviewComment = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + NewPosition : int option + [] + OldPosition : int option + [] + Path : string option + } + +/// CreatePushMirrorOption represents need information to create a push mirror of a repository. +[] +type CreatePushMirrorOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Interval : string option + [] + RemoteAddress : string option + [] + RemotePassword : string option + [] + RemoteUsername : string option + [] + SyncOnCommit : bool option + } + +/// CreateReleaseOption options when creating a release +[] +type CreateReleaseOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + Draft : bool option + [] + Name : string option + [] + Prerelease : bool option + [] + TagName : string + [] + TargetCommitish : string option + } + +/// CreateRepoOption options when creating repository +[] +type CreateRepoOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AutoInit : bool option + [] + DefaultBranch : string option + [] + Description : string option + [] + Gitignores : string option + [] + IssueLabels : string option + [] + License : string option + [] + Name : string + [] + Private : bool option + [] + Readme : string option + [] + Template : bool option + [] + TrustModel : string option + } + +/// CreateStatusOption holds the information needed to create a new CommitStatus for a Commit +[] +type CreateStatusOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Context : string option + [] + Description : string option + [] + State : string option + [] + TargetUrl : string option + } + +/// CreateTagOption options when creating a tag +[] +type CreateTagOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Message : string option + [] + TagName : string + [] + Target : string option + } + +[] +type Type1 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// CreateTeamOption options for creating a team +[] +type CreateTeamOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CanCreateOrgRepo : bool option + [] + Description : string option + [] + IncludesAllRepositories : bool option + [] + Name : string + [] + Permission : string option + [] + Units : string list option + [] + UnitsMap : Type1 option + } + +/// CreateUserOption create user options +[] +type CreateUserOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CreatedAt : string option + [] + Email : string + [] + FullName : string option + [] + LoginName : string option + [] + MustChangePassword : bool option + [] + Password : string + [] + Restricted : bool option + [] + SendNotify : bool option + [] + SourceId : int option + [] + Username : string + [] + Visibility : string option + } + +/// CreateWikiPageOptions form for creating wiki +[] +type CreateWikiPageOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ContentBase64 : string option + [] + Message : string option + [] + Title : string option + } + +/// Cron represents a Cron task +[] +type Cron = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ExecTimes : int option + [] + Name : string option + [] + Next : string option + [] + Prev : string option + [] + Schedule : string option + } + +/// DeleteEmailOption options when deleting email addresses +[] +type DeleteEmailOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Emails : string list option + } + +/// DismissPullReviewOptions are options to dismiss a pull review +[] +type DismissPullReviewOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Message : string option + [] + Priors : bool option + } + +/// EditAttachmentOptions options for editing attachments +[] +type EditAttachmentOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Name : string option + } + +/// EditBranchProtectionOption options for editing a branch protection +[] +type EditBranchProtectionOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ApprovalsWhitelistTeams : string list option + [] + ApprovalsWhitelistUsername : string list option + [] + BlockOnOfficialReviewRequests : bool option + [] + BlockOnOutdatedBranch : bool option + [] + BlockOnRejectedReviews : bool option + [] + DismissStaleApprovals : bool option + [] + EnableApprovalsWhitelist : bool option + [] + EnableMergeWhitelist : bool option + [] + EnablePush : bool option + [] + EnablePushWhitelist : bool option + [] + EnableStatusCheck : bool option + [] + MergeWhitelistTeams : string list option + [] + MergeWhitelistUsernames : string list option + [] + ProtectedFilePatterns : string option + [] + PushWhitelistDeployKeys : bool option + [] + PushWhitelistTeams : string list option + [] + PushWhitelistUsernames : string list option + [] + RequireSignedCommits : bool option + [] + RequiredApprovals : int option + [] + StatusCheckContexts : string list option + [] + UnprotectedFilePatterns : string option + } + +/// EditDeadlineOption options for creating a deadline +[] +type EditDeadlineOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + DueDate : string + } + +/// EditGitHookOption options when modifying one Git hook +[] +type EditGitHookOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Content : string option + } + +[] +type Type2 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// EditHookOption options when modify one hook +[] +type EditHookOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Active : bool option + [] + AuthorizationHeader : string option + [] + BranchFilter : string option + [] + Config : Type2 option + [] + Events : string list option + } + +/// EditIssueCommentOption options for editing a comment +[] +type EditIssueCommentOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string + } + +/// EditIssueOption options for editing an issue +[] +type EditIssueOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assignee : string option + [] + Assignees : string list option + [] + Body : string option + [] + DueDate : string option + [] + Milestone : int option + [] + Ref : string option + [] + State : string option + [] + Title : string option + [] + UnsetDueDate : bool option + } + +/// EditLabelOption options for editing a label +[] +type EditLabelOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Color : string option + [] + Description : string option + [] + Exclusive : bool option + [] + Name : string option + } + +/// EditMilestoneOption options for editing a milestone +[] +type EditMilestoneOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Description : string option + [] + DueOn : string option + [] + State : string option + [] + Title : string option + } + +/// EditOrgOption options for editing an organization +[] +type EditOrgOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Description : string option + [] + FullName : string option + [] + Location : string option + [] + RepoAdminChangeTeamAccess : bool option + [] + Visibility : string option + [] + Website : string option + } + +/// EditPullRequestOption options when modify pull request +[] +type EditPullRequestOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowMaintainerEdit : bool option + [] + Assignee : string option + [] + Assignees : string list option + [] + Base : string option + [] + Body : string option + [] + DueDate : string option + [] + Labels : int list option + [] + Milestone : int option + [] + State : string option + [] + Title : string option + [] + UnsetDueDate : bool option + } + +/// EditReactionOption contain the reaction type +[] +type EditReactionOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Content : string option + } + +/// EditReleaseOption options when editing a release +[] +type EditReleaseOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + Draft : bool option + [] + Name : string option + [] + Prerelease : bool option + [] + TagName : string option + [] + TargetCommitish : string option + } + +[] +type Type3 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// EditTeamOption options for editing a team +[] +type EditTeamOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CanCreateOrgRepo : bool option + [] + Description : string option + [] + IncludesAllRepositories : bool option + [] + Name : string + [] + Permission : string option + [] + Units : string list option + [] + UnitsMap : Type3 option + } + +/// EditUserOption edit user options +[] +type EditUserOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Active : bool option + [] + Admin : bool option + [] + AllowCreateOrganization : bool option + [] + AllowGitHook : bool option + [] + AllowImportLocal : bool option + [] + Description : string option + [] + Email : string option + [] + FullName : string option + [] + Location : string option + [] + LoginName : string + [] + MaxRepoCreation : int option + [] + MustChangePassword : bool option + [] + Password : string option + [] + ProhibitLogin : bool option + [] + Restricted : bool option + [] + SourceId : int + [] + Visibility : string option + [] + Website : string option + } + +/// Email an email address belonging to a user +[] +type Email = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Email : string option + [] + Primary : bool option + [] + Verified : bool option + } + +/// ExternalTracker represents settings for external tracker +[] +type ExternalTracker = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ExternalTrackerFormat : string option + [] + ExternalTrackerRegexpPattern : string option + [] + ExternalTrackerStyle : string option + [] + ExternalTrackerUrl : string option + } + +/// ExternalWiki represents setting for external wiki +[] +type ExternalWiki = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ExternalWikiUrl : string option + } + +/// FileCommitResponse contains information generated from a Git commit for a repo's file. +[] +type FileCommitResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : CommitUser option + [] + Committer : CommitUser option + [] + Created : string option + [] + HtmlUrl : string option + [] + Message : string option + [] + Parents : CommitMeta list option + [] + Sha : string option + [] + Tree : CommitMeta option + [] + Url : string option + } + +/// FileLinksResponse contains the links for a repo's file +[] +type FileLinksResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Git : string option + [] + Html : string option + [] + Self : string option + } + +/// GPGKeyEmail an email attached to a GPGKey +[] +type GPGKeyEmail = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Email : string option + [] + Verified : bool option + } + +/// GeneralAPISettings contains global api settings exposed by it +[] +type GeneralAPISettings = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + DefaultGitTreesPerPage : int option + [] + DefaultMaxBlobSize : int option + [] + DefaultPagingNum : int option + [] + MaxResponseItems : int option + } + +/// GeneralAttachmentSettings contains global Attachment settings exposed by API +[] +type GeneralAttachmentSettings = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowedTypes : string option + [] + Enabled : bool option + [] + MaxFiles : int option + [] + MaxSize : int option + } + +/// GeneralRepoSettings contains global repository settings exposed by API +[] +type GeneralRepoSettings = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + HttpGitDisabled : bool option + [] + LfsDisabled : bool option + [] + MigrationsDisabled : bool option + [] + MirrorsDisabled : bool option + [] + StarsDisabled : bool option + [] + TimeTrackingDisabled : bool option + } + +/// GeneralUISettings contains global ui settings exposed by API +[] +type GeneralUISettings = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowedReactions : string list option + [] + CustomEmojis : string list option + [] + DefaultTheme : string option + } + +/// GenerateRepoOption options when creating repository using a template +[] +type GenerateRepoOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Avatar : bool option + [] + DefaultBranch : string option + [] + Description : string option + [] + GitContent : bool option + [] + GitHooks : bool option + [] + Labels : bool option + [] + Name : string + [] + Owner : string + [] + Private : bool option + [] + Topics : bool option + [] + Webhooks : bool option + } + +/// GitBlobResponse represents a git blob +[] +type GitBlobResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Content : string option + [] + Encoding : string option + [] + Sha : string option + [] + Size : int option + [] + Url : string option + } + +/// GitEntry represents a git tree +[] +type GitEntry = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Mode : string option + [] + Path : string option + [] + Sha : string option + [] + Size : int option + [] + Type : string option + [] + Url : string option + } + +/// GitHook represents a Git repository hook +[] +type GitHook = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Content : string option + [] + IsActive : bool option + [] + Name : string option + } + +/// GitObject represents a Git object. +[] +type GitObject = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Sha : string option + [] + Type : string option + [] + Url : string option + } + +/// GitTreeResponse returns a git tree +[] +type GitTreeResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Page : int option + [] + Sha : string option + [] + TotalCount : int option + [] + Tree : GitEntry list option + [] + Truncated : bool option + [] + Url : string option + } + +[] +type Type4 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// Hook a hook is a web hook when one repository changed +[] +type Hook = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Active : bool option + [] + AuthorizationHeader : string option + [] + Config : Type4 option + [] + CreatedAt : string option + [] + Events : string list option + [] + Id : int option + [] + Type : string option + [] + UpdatedAt : string option + } + +/// Identity for a person's identity like an author or committer +[] +type Identity = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Email : string option + [] + Name : string option + } + +/// InternalTracker represents settings for internal tracker +[] +type InternalTracker = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowOnlyContributorsToTrackTime : bool option + [] + EnableIssueDependencies : bool option + [] + EnableTimeTracker : bool option + } + +/// IssueDeadline represents an issue deadline +[] +type IssueDeadline = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + DueDate : string option + } + +[] +type Type5 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +[] +type Type6 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// IssueLabelsOption a collection of labels +[] +type IssueLabelsOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Labels : int list option + } + +/// Label a label to an issue or a pr +[] +type Label = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Color : string option + [] + Description : string option + [] + Exclusive : bool option + [] + Id : int option + [] + Name : string option + [] + Url : string option + } + +/// MarkdownOption markdown options +[] +type MarkdownOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Context : string option + [] + Mode : string option + [] + Text : string option + [] + Wiki : bool option + } + +/// MergePullRequestForm form for merging Pull Request +[] +type MergePullRequestOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Do : string + [] + MergeCommitID : string option + [] + MergeMessageField : string option + [] + MergeTitleField : string option + [] + DeleteBranchAfterMerge : bool option + [] + ForceMerge : bool option + [] + HeadCommitId : string option + [] + MergeWhenChecksSucceed : bool option + } + +/// MigrateRepoOptions options for migrating repository's +/// this is used to interact with api v1 +[] +type MigrateRepoOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AuthPassword : string option + [] + AuthToken : string option + [] + AuthUsername : string option + [] + CloneAddr : string + [] + Description : string option + [] + Issues : bool option + [] + Labels : bool option + [] + Lfs : bool option + [] + LfsEndpoint : string option + [] + Milestones : bool option + [] + Mirror : bool option + [] + MirrorInterval : string option + [] + Private : bool option + [] + PullRequests : bool option + [] + Releases : bool option + [] + RepoName : string + [] + RepoOwner : string option + [] + Service : string option + [] + Uid : int option + [] + Wiki : bool option + } + +[] +type Type7 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// NodeInfoServices contains the third party sites this server can connect to via their application API +[] +type NodeInfoServices = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Inbound : string list option + [] + Outbound : string list option + } + +/// NodeInfoSoftware contains Metadata about server software in use +[] +type NodeInfoSoftware = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Homepage : string option + [] + Name : string option + [] + Repository : string option + [] + Version : string option + } + +/// NodeInfoUsageUsers contains statistics about the users of this server +[] +type NodeInfoUsageUsers = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ActiveHalfyear : int option + [] + ActiveMonth : int option + [] + Total : int option + } + +/// NotificationCount number of unread notifications +[] +type NotificationCount = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + New : int option + } + +/// OAuth2Application represents an OAuth2 application. +[] +type OAuth2Application = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ClientId : string option + [] + ClientSecret : string option + [] + ConfidentialClient : bool option + [] + Created : string option + [] + Id : int option + [] + Name : string option + [] + RedirectUris : string list option + } + +/// Organization represents an organization +[] +type Organization = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AvatarUrl : string option + [] + Description : string option + [] + FullName : string option + [] + Id : int option + [] + Location : string option + [] + Name : string option + [] + RepoAdminChangeTeamAccess : bool option + [] + Username : string option + [] + Visibility : string option + [] + Website : string option + } + +/// OrganizationPermissions list different users permissions on an organization +[] +type OrganizationPermissions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CanCreateRepository : bool option + [] + CanRead : bool option + [] + CanWrite : bool option + [] + IsAdmin : bool option + [] + IsOwner : bool option + } + +/// PackageFile represents a package file +[] +type PackageFile = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Size : int option + [] + Id : int option + [] + Md5 : string option + [] + Name : string option + [] + Sha1 : string option + [] + Sha256 : string option + [] + Sha512 : string option + } + +/// PayloadUser represents the author or committer of a commit +[] +type PayloadUser = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Email : string option + [] + Name : string option + [] + Username : string option + } + +/// Permission represents a set of permissions +[] +type Permission = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Admin : bool option + [] + Pull : bool option + [] + Push : bool option + } + +/// PullRequestMeta PR info if an issue is a PR +[] +type PullRequestMeta = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Merged : bool option + [] + MergedAt : string option + } + +/// PullReviewRequestOptions are options to add or remove pull review requests +[] +type PullReviewRequestOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Reviewers : string list option + [] + TeamReviewers : string list option + } + +/// PushMirror represents information of a push mirror +[] +type PushMirror = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Created : string option + [] + Interval : string option + [] + LastError : string option + [] + LastUpdate : string option + [] + RemoteAddress : string option + [] + RemoteName : string option + [] + RepoName : string option + [] + SyncOnCommit : bool option + } + +/// Reference represents a Git reference. +[] +type Reference = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Object : GitObject option + [] + Ref : string option + [] + Url : string option + } + +/// RepoTopicOptions a collection of repo topic names +[] +type RepoTopicOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Topics : string list option + } + +/// RepositoryMeta basic repository information +[] +type RepositoryMeta = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + FullName : string option + [] + Id : int option + [] + Name : string option + [] + Owner : string option + } + +/// ServerVersion wraps the version of the server +[] +type ServerVersion = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Version : string option + } + +/// StopWatch represent a running stopwatch +[] +type StopWatch = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Created : string option + [] + Duration : string option + [] + IssueIndex : int option + [] + IssueTitle : string option + [] + RepoName : string option + [] + RepoOwnerName : string option + [] + Seconds : int option + } + +/// SubmitPullReviewOptions are options to submit a pending pull review +[] +type SubmitPullReviewOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + Event : string option + } + +/// Tag represents a repository tag +[] +type Tag = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Commit : CommitMeta option + [] + Id : string option + [] + Message : string option + [] + Name : string option + [] + TarballUrl : string option + [] + ZipballUrl : string option + } + +[] +type Type8 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// Team represents a team in an organization +[] +type Team = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CanCreateOrgRepo : bool option + [] + Description : string option + [] + Id : int option + [] + IncludesAllRepositories : bool option + [] + Name : string option + [] + Organization : Organization option + [] + Permission : string option + [] + Units : string list option + [] + UnitsMap : Type8 option + } + +/// TopicName a list of repo topic names +[] +type TopicName = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Topics : string list option + } + +/// TopicResponse for returning topics +[] +type TopicResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Created : string option + [] + Id : int option + [] + RepoCount : int option + [] + TopicName : string option + [] + Updated : string option + } + +/// TransferRepoOption options when transfer a repository's ownership +[] +type TransferRepoOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + NewOwner : string + [] + TeamIds : int list option + } + +/// UpdateFileOptions options for updating files +/// Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) +[] +type UpdateFileOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : Identity option + [] + Branch : string option + [] + Committer : Identity option + [] + Content : string + [] + Dates : CommitDateOptions option + [] + FromPath : string option + [] + Message : string option + [] + NewBranch : string option + [] + Sha : string + [] + Signoff : bool option + } + +/// User represents a user +[] +type User = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Active : bool option + [] + AvatarUrl : string option + [] + Created : string option + [] + Description : string option + [] + Email : string option + [] + FollowersCount : int option + [] + FollowingCount : int option + [] + FullName : string option + [] + Id : int option + [] + IsAdmin : bool option + [] + Language : string option + [] + LastLogin : string option + [] + Location : string option + [] + Login : string option + [] + LoginName : string option + [] + ProhibitLogin : bool option + [] + Restricted : bool option + [] + StarredReposCount : int option + [] + Visibility : string option + [] + Website : string option + } + +/// UserHeatmapData represents the data needed to create a heatmap +[] +type UserHeatmapData = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Contributions : int option + [] + Timestamp : int option + } + +/// UserSettings represents user settings +[] +type UserSettings = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Description : string option + [] + DiffViewStyle : string option + [] + FullName : string option + [] + HideActivity : bool option + [] + HideEmail : bool option + [] + Language : string option + [] + Location : string option + [] + Theme : string option + [] + Website : string option + } + +/// UserSettingsOptions represents options to change user settings +[] +type UserSettingsOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Description : string option + [] + DiffViewStyle : string option + [] + FullName : string option + [] + HideActivity : bool option + [] + HideEmail : bool option + [] + Language : string option + [] + Location : string option + [] + Theme : string option + [] + Website : string option + } + +/// WatchInfo represents an API watch status of one repository +[] +type WatchInfo = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CreatedAt : string option + [] + Ignored : bool option + [] + Reason : unit option + [] + RepositoryUrl : string option + [] + Subscribed : bool option + [] + Url : string option + } + +/// WikiCommit page commit/revision +[] +type WikiCommit = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : CommitUser option + [] + Commiter : CommitUser option + [] + Message : string option + [] + Sha : string option + } + +/// WikiCommitList commit/revision list +[] +type WikiCommitList = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Commits : WikiCommit list option + [] + Count : int option + } + +/// WikiPage a wiki page +[] +type WikiPage = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CommitCount : int option + [] + ContentBase64 : string option + [] + Footer : string option + [] + HtmlUrl : string option + [] + LastCommit : WikiCommit option + [] + Sidebar : string option + [] + SubUrl : string option + [] + Title : string option + } + +/// WikiPageMetaData wiki page meta information +[] +type WikiPageMetaData = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + HtmlUrl : string option + [] + LastCommit : WikiCommit option + [] + SubUrl : string option + [] + Title : string option + } + +/// Comment represents a comment on a commit or issue +[] +type Comment = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assets : Attachment list option + [] + Body : string option + [] + CreatedAt : string option + [] + HtmlUrl : string option + [] + Id : int option + [] + IssueUrl : string option + [] + OriginalAuthor : string option + [] + OriginalAuthorId : int option + [] + PullRequestUrl : string option + [] + UpdatedAt : string option + [] + User : User option + } + +/// CommitStatus holds a single status of a single Commit +[] +type CommitStatus = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Context : string option + [] + CreatedAt : string option + [] + Creator : User option + [] + Description : string option + [] + Id : int option + [] + Status : string option + [] + TargetUrl : string option + [] + UpdatedAt : string option + [] + Url : string option + } + +/// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content +[] +type ContentsResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Links : FileLinksResponse option + [] + Content : string option + [] + DownloadUrl : string option + [] + Encoding : string option + [] + GitUrl : string option + [] + HtmlUrl : string option + [] + LastCommitSha : string option + [] + Name : string option + [] + Path : string option + [] + Sha : string option + [] + Size : int option + [] + SubmoduleGitUrl : string option + [] + Target : string option + [] + Type : string option + [] + Url : string option + } + +/// CreateFileOptions options for creating files +/// Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) +[] +type CreateFileOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : Identity option + [] + Branch : string option + [] + Committer : Identity option + [] + Content : string + [] + Dates : CommitDateOptions option + [] + Message : string option + [] + NewBranch : string option + [] + Signoff : bool option + } + +/// CreateHookOption options when create a hook +[] +type CreateHookOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Active : bool option + [] + AuthorizationHeader : string option + [] + BranchFilter : string option + [] + Config : CreateHookOptionConfig + [] + Events : string list option + [] + Type : string + } + +/// CreatePullReviewOptions are options to create a pull review +[] +type CreatePullReviewOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + Comments : CreatePullReviewComment list option + [] + CommitId : string option + [] + Event : string option + } + +/// DeleteFileOptions options for deleting files (used for other File structs below) +/// Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) +[] +type DeleteFileOptions = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : Identity option + [] + Branch : string option + [] + Committer : Identity option + [] + Dates : CommitDateOptions option + [] + Message : string option + [] + NewBranch : string option + [] + Sha : string + [] + Signoff : bool option + } + +/// EditRepoOption options when editing a repository's properties +[] +type EditRepoOption = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowManualMerge : bool option + [] + AllowMergeCommits : bool option + [] + AllowRebase : bool option + [] + AllowRebaseExplicit : bool option + [] + AllowRebaseUpdate : bool option + [] + AllowSquashMerge : bool option + [] + Archived : bool option + [] + AutodetectManualMerge : bool option + [] + DefaultAllowMaintainerEdit : bool option + [] + DefaultBranch : string option + [] + DefaultDeleteBranchAfterMerge : bool option + [] + DefaultMergeStyle : string option + [] + Description : string option + [] + EnablePrune : bool option + [] + ExternalTracker : ExternalTracker option + [] + ExternalWiki : ExternalWiki option + [] + HasIssues : bool option + [] + HasProjects : bool option + [] + HasPullRequests : bool option + [] + HasWiki : bool option + [] + IgnoreWhitespaceConflicts : bool option + [] + InternalTracker : InternalTracker option + [] + MirrorInterval : string option + [] + Name : string option + [] + Private : bool option + [] + Template : bool option + [] + Website : string option + } + +/// IssueFormField represents a form field +[] +type IssueFormField = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Attributes : Type5 option + [] + Id : string option + [] + Type : string option + [] + Validations : Type6 option + } + +/// IssueTemplate represents an issue template for a repository +[] +type IssueTemplate = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + About : string option + [] + Body : IssueFormField list option + [] + Content : string option + [] + FileName : string option + [] + Labels : string list option + [] + Name : string option + [] + Ref : string option + [] + Title : string option + } + +/// Milestone milestone is a collection of issues on one repository +[] +type Milestone = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + ClosedAt : string option + [] + ClosedIssues : int option + [] + CreatedAt : string option + [] + Description : string option + [] + DueOn : string option + [] + Id : int option + [] + OpenIssues : int option + [] + State : string option + [] + Title : string option + [] + UpdatedAt : string option + } + +/// NodeInfoUsage contains usage statistics for this server +[] +type NodeInfoUsage = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + LocalComments : int option + [] + LocalPosts : int option + [] + Users : NodeInfoUsageUsers option + } + +/// NotificationSubject contains the notification subject (Issue/Pull/Commit) +[] +type NotificationSubject = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + HtmlUrl : string option + [] + LatestCommentHtmlUrl : string option + [] + LatestCommentUrl : string option + [] + State : string option + [] + Title : string option + [] + Type : string option + [] + Url : string option + } + +/// PayloadCommitVerification represents the GPG verification of a commit +[] +type PayloadCommitVerification = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Payload : string option + [] + Reason : string option + [] + Signature : string option + [] + Signer : PayloadUser option + [] + Verified : bool option + } + +/// PublicKey publickey is a user key to push code to repository +[] +type PublicKey = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CreatedAt : string option + [] + Fingerprint : string option + [] + Id : int option + [] + Key : string option + [] + KeyType : string option + [] + ReadOnly : bool option + [] + Title : string option + [] + Url : string option + [] + User : User option + } + +/// PullReview represents a pull request review +[] +type PullReview = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + CommentsCount : int option + [] + CommitId : string option + [] + Dismissed : bool option + [] + HtmlUrl : string option + [] + Id : int option + [] + Official : bool option + [] + PullRequestUrl : string option + [] + Stale : bool option + [] + State : string option + [] + SubmittedAt : string option + [] + Team : Team option + [] + UpdatedAt : string option + [] + User : User option + } + +/// PullReviewComment represents a comment on a pull request review +[] +type PullReviewComment = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Body : string option + [] + CommitId : string option + [] + CreatedAt : string option + [] + DiffHunk : string option + [] + HtmlUrl : string option + [] + Id : int option + [] + OriginalCommitId : string option + [] + OriginalPosition : int option + [] + Path : string option + [] + Position : int option + [] + PullRequestReviewId : int option + [] + PullRequestUrl : string option + [] + Resolver : User option + [] + UpdatedAt : string option + [] + User : User option + } + +/// Reaction contain one reaction +[] +type Reaction = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Content : string option + [] + CreatedAt : string option + [] + User : User option + } + +/// Release represents a repository release +[] +type Release = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assets : Attachment list option + [] + Author : User option + [] + Body : string option + [] + CreatedAt : string option + [] + Draft : bool option + [] + HtmlUrl : string option + [] + Id : int option + [] + Name : string option + [] + Prerelease : bool option + [] + PublishedAt : string option + [] + TagName : string option + [] + TarballUrl : string option + [] + TargetCommitish : string option + [] + Url : string option + [] + ZipballUrl : string option + } + +/// RepoCollaboratorPermission to get repository permission for a collaborator +[] +type RepoCollaboratorPermission = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Permission : string option + [] + RoleName : string option + [] + User : User option + } + +/// RepoCommit contains information of a commit in the context of a repository. +[] +type RepoCommit = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : CommitUser option + [] + Committer : CommitUser option + [] + Message : string option + [] + Tree : CommitMeta option + [] + Url : string option + [] + Verification : PayloadCommitVerification option + } + +/// RepoTransfer represents a pending repo transfer +[] +type RepoTransfer = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Doer : User option + [] + Recipient : User option + [] + Teams : Team list option + } + +/// Repository represents a repository +[] +type Repository = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowMergeCommits : bool option + [] + AllowRebase : bool option + [] + AllowRebaseExplicit : bool option + [] + AllowRebaseUpdate : bool option + [] + AllowSquashMerge : bool option + [] + Archived : bool option + [] + AvatarUrl : string option + [] + CloneUrl : string option + [] + CreatedAt : string option + [] + DefaultAllowMaintainerEdit : bool option + [] + DefaultBranch : string option + [] + DefaultDeleteBranchAfterMerge : bool option + [] + DefaultMergeStyle : string option + [] + Description : string option + [] + Empty : bool option + [] + ExternalTracker : ExternalTracker option + [] + ExternalWiki : ExternalWiki option + [] + Fork : bool option + [] + ForksCount : int option + [] + FullName : string option + [] + HasIssues : bool option + [] + HasProjects : bool option + [] + HasPullRequests : bool option + [] + HasWiki : bool option + [] + HtmlUrl : string option + [] + Id : int option + [] + IgnoreWhitespaceConflicts : bool option + [] + Internal : bool option + [] + InternalTracker : InternalTracker option + [] + Language : string option + [] + LanguagesUrl : string option + [] + Link : string option + [] + Mirror : bool option + [] + MirrorInterval : string option + [] + MirrorUpdated : string option + [] + Name : string option + [] + OpenIssuesCount : int option + [] + OpenPrCounter : int option + [] + OriginalUrl : string option + [] + Owner : User option + [] + Parent : Repository option + [] + Permissions : Permission option + [] + Private : bool option + [] + ReleaseCounter : int option + [] + RepoTransfer : RepoTransfer option + [] + Size : int option + [] + SshUrl : string option + [] + StarsCount : int option + [] + Template : bool option + [] + UpdatedAt : string option + [] + WatchersCount : int option + [] + Website : string option + } + +/// SearchResults results of a successful search +[] +type SearchResults = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Data : Repository list option + [] + Ok : bool option + } + +/// AnnotatedTag represents an annotated tag +[] +type AnnotatedTag = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Message : string option + [] + Object : AnnotatedTagObject option + [] + Sha : string option + [] + Tag : string option + [] + Tagger : CommitUser option + [] + Url : string option + [] + Verification : PayloadCommitVerification option + } + +/// CombinedStatus holds the combined state of several statuses for a single commit +[] +type CombinedStatus = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CommitUrl : string option + [] + Repository : Repository option + [] + Sha : string option + [] + State : string option + [] + Statuses : CommitStatus list option + [] + TotalCount : int option + [] + Url : string option + } + +/// Commit contains information generated from a Git commit. +[] +type Commit = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Author : User option + [] + Commit : RepoCommit option + [] + Committer : User option + [] + Created : string option + [] + Files : CommitAffectedFiles list option + [] + HtmlUrl : string option + [] + Parents : CommitMeta list option + [] + Sha : string option + [] + Stats : CommitStats option + [] + Url : string option + } + +/// DeployKey a deploy key +[] +type DeployKey = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CreatedAt : string option + [] + Fingerprint : string option + [] + Id : int option + [] + Key : string option + [] + KeyId : int option + [] + ReadOnly : bool option + [] + Repository : Repository option + [] + Title : string option + [] + Url : string option + } + +/// FileDeleteResponse contains information about a repo's file that was deleted +[] +type FileDeleteResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Commit : FileCommitResponse option + [] + Content : unit option + [] + Verification : PayloadCommitVerification option + } + +/// FileResponse contains information about a repo's file +[] +type FileResponse = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Commit : FileCommitResponse option + [] + Content : ContentsResponse option + [] + Verification : PayloadCommitVerification option + } + +/// Issue represents an issue in a repository +[] +type Issue = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assets : Attachment list option + [] + Assignee : User option + [] + Assignees : User list option + [] + Body : string option + [] + ClosedAt : string option + [] + Comments : int option + [] + CreatedAt : string option + [] + DueDate : string option + [] + HtmlUrl : string option + [] + Id : int option + [] + IsLocked : bool option + [] + Labels : Label list option + [] + Milestone : Milestone option + [] + Number : int option + [] + OriginalAuthor : string option + [] + OriginalAuthorId : int option + [] + PullRequest : PullRequestMeta option + [] + Ref : string option + [] + Repository : RepositoryMeta option + [] + State : string option + [] + Title : string option + [] + UpdatedAt : string option + [] + Url : string option + [] + User : User option + } + +/// NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks +[] +type NodeInfo = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Metadata : Type7 option + [] + OpenRegistrations : bool option + [] + Protocols : string list option + [] + Services : NodeInfoServices option + [] + Software : NodeInfoSoftware option + [] + Usage : NodeInfoUsage option + [] + Version : string option + } + +/// Note contains information related to a git note +[] +type Note = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Commit : Commit option + [] + Message : string option + } + +/// NotificationThread expose Notification on API +[] +type NotificationThread = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Id : int option + [] + Pinned : bool option + [] + Repository : Repository option + [] + Subject : NotificationSubject option + [] + Unread : bool option + [] + UpdatedAt : string option + [] + Url : string option + } + +/// PRBranchInfo information about a branch +[] +type PRBranchInfo = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Label : string option + [] + Ref : string option + [] + Repo : Repository option + [] + RepoId : int option + [] + Sha : string option + } + +/// Package represents a package +[] +type Package = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + CreatedAt : string option + [] + Creator : User option + [] + Id : int option + [] + Name : string option + [] + Owner : User option + [] + Repository : Repository option + [] + Type : string option + [] + Version : string option + } + +/// PayloadCommit represents a commit +[] +type PayloadCommit = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Added : string list option + [] + Author : PayloadUser option + [] + Committer : PayloadUser option + [] + Id : string option + [] + Message : string option + [] + Modified : string list option + [] + Removed : string list option + [] + Timestamp : string option + [] + Url : string option + [] + Verification : PayloadCommitVerification option + } + +/// PullRequest represents a pull request +[] +type PullRequest = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + AllowMaintainerEdit : bool option + [] + Assignee : User option + [] + Assignees : User list option + [] + Base : PRBranchInfo option + [] + Body : string option + [] + ClosedAt : string option + [] + Comments : int option + [] + CreatedAt : string option + [] + DiffUrl : string option + [] + DueDate : string option + [] + Head : PRBranchInfo option + [] + HtmlUrl : string option + [] + Id : int option + [] + IsLocked : bool option + [] + Labels : Label list option + [] + MergeBase : string option + [] + MergeCommitSha : string option + [] + Mergeable : bool option + [] + Merged : bool option + [] + MergedAt : string option + [] + MergedBy : User option + [] + Milestone : Milestone option + [] + Number : int option + [] + PatchUrl : string option + [] + State : string option + [] + Title : string option + [] + UpdatedAt : string option + [] + Url : string option + [] + User : User option + } + +/// TrackedTime worked time for an issue / pr +[] +type TrackedTime = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Created : string option + [] + Id : int option + [] + Issue : Issue option + [] + IssueId : int option + [] + Time : int option + [] + UserId : int option + [] + UserName : string option + } + +/// Branch represents a repository branch +[] +type Branch = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Commit : PayloadCommit option + [] + EffectiveBranchProtectionName : string option + [] + EnableStatusCheck : bool option + [] + Name : string option + [] + Protected : bool option + [] + RequiredApprovals : int option + [] + StatusCheckContexts : string list option + [] + UserCanMerge : bool option + [] + UserCanPush : bool option + } + +/// TimelineComment represents a timeline comment (comment of any type) on a commit or issue +[] +type TimelineComment = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + [] + Assignee : User option + [] + AssigneeTeam : Team option + [] + Body : string option + [] + CreatedAt : string option + [] + DependentIssue : Issue option + [] + HtmlUrl : string option + [] + Id : int option + [] + IssueUrl : string option + [] + Label : Label option + [] + Milestone : Milestone option + [] + NewRef : string option + [] + NewTitle : string option + [] + OldMilestone : Milestone option + [] + OldProjectId : int option + [] + OldRef : string option + [] + OldTitle : string option + [] + ProjectId : int option + [] + PullRequestUrl : string option + [] + RefAction : string option + [] + RefComment : Comment option + [] + RefCommitSha : string option + [] + RefIssue : Issue option + [] + RemovedAssignee : bool option + [] + ResolveDoer : User option + [] + ReviewId : int option + [] + TrackedTime : TrackedTime option + [] + Type : string option + [] + UpdatedAt : string option + [] + User : User option + } + +[] +type LanguageStatistics = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + } + +/// This documentation describes the Gitea API. +[] +type IGitea = + /// Returns the Person actor for a user + [] + [] + abstract ActivitypubPerson : + [] username : string * ?ct : System.Threading.CancellationToken -> + ActivityPub System.Threading.Tasks.Task + + /// Send to the inbox + [] + [] + abstract ActivitypubPersonInbox : + [] username : string * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List cron tasks + [] + [] + abstract AdminCronList : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Cron list System.Threading.Tasks.Task + + /// Run cron task + [] + [] + abstract AdminCronRun : + [] task : string * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List system's webhooks + [] + [] + abstract AdminListHooks : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Hook list System.Threading.Tasks.Task + + /// Create a hook + [] + [] + abstract AdminCreateHook : + [] body : CreateHookOption * ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// Get a hook + [] + [] + abstract AdminGetHook : + [] id : int * ?ct : System.Threading.CancellationToken -> Hook System.Threading.Tasks.Task + + /// Update a hook + [] + [] + abstract AdminEditHook : + [] id : int * + [] body : EditHookOption * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// List all organizations + [] + [] + abstract AdminGetAllOrgs : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Organization list System.Threading.Tasks.Task + + /// List unadopted repositories + [] + [] + abstract AdminUnadoptedList : + [] page : int * + [] limit : int * + [] pattern : string * + ?ct : System.Threading.CancellationToken -> + string list System.Threading.Tasks.Task + + /// Adopt unadopted files as a repository + [] + [] + abstract AdminAdoptRepository : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Delete unadopted files + [] + [] + abstract AdminDeleteUnadoptedRepository : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List all users + [] + [] + abstract AdminGetAllUsers : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Create a user + [] + [] + abstract AdminCreateUser : + [] body : CreateUserOption * ?ct : System.Threading.CancellationToken -> + User System.Threading.Tasks.Task + + /// Delete a user + [] + [] + abstract AdminDeleteUser : + [] username : string * + [] purge : bool * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit an existing user + [] + [] + abstract AdminEditUser : + [] username : string * + [] body : EditUserOption * + ?ct : System.Threading.CancellationToken -> + User System.Threading.Tasks.Task + + /// Add a public key on behalf of a user + [] + [] + abstract AdminCreatePublicKey : + [] username : string * + [] key : CreateKeyOption * + ?ct : System.Threading.CancellationToken -> + PublicKey System.Threading.Tasks.Task + + /// Delete a user's public key + [] + [] + abstract AdminDeleteUserPublicKey : + [] username : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Create an organization + [] + [] + abstract AdminCreateOrg : + [] username : string * + [] organization : CreateOrgOption * + ?ct : System.Threading.CancellationToken -> + Organization System.Threading.Tasks.Task + + /// Create a repository on behalf of a user + [] + [] + abstract AdminCreateRepo : + [] username : string * + [] repository : CreateRepoOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Delete a hook + [] + [] + abstract AdminDeleteHook : + [] id : int * ?ct : System.Threading.CancellationToken -> unit System.Threading.Tasks.Task + + /// Render a markdown document as HTML + [] + [] + abstract RenderMarkdown : + [] body : MarkdownOption * ?ct : System.Threading.CancellationToken -> + string System.Threading.Tasks.Task + + /// Render raw markdown as HTML + [] + [] + abstract RenderMarkdownRaw : + [] body : string * ?ct : System.Threading.CancellationToken -> string System.Threading.Tasks.Task + + /// Returns the nodeinfo of the Gitea application + [] + [] + abstract GetNodeInfo : ?ct : System.Threading.CancellationToken -> NodeInfo System.Threading.Tasks.Task + + /// List users's notification threads + [] + [] + abstract NotifyGetList : + [] all : bool * + [] status_types : string list * + [] subject_type : string list * + [] since : string * + [] before : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + NotificationThread list System.Threading.Tasks.Task + + /// Mark notification threads as read, pinned or unread + [] + [] + abstract NotifyReadList : + [] last_read_at : string * + [] all : string * + [] status_types : string list * + [] to_status : string * + ?ct : System.Threading.CancellationToken -> + NotificationThread list System.Threading.Tasks.Task + + /// Check if unread notifications exist + [] + [] + abstract NotifyNewAvailable : + ?ct : System.Threading.CancellationToken -> NotificationCount System.Threading.Tasks.Task + + /// Get notification thread by ID + [] + [] + abstract NotifyGetThread : + [] id : string * ?ct : System.Threading.CancellationToken -> + NotificationThread System.Threading.Tasks.Task + + /// Mark notification thread as read by ID + [] + [] + abstract NotifyReadThread : + [] id : string * + [] to_status : string * + ?ct : System.Threading.CancellationToken -> + NotificationThread System.Threading.Tasks.Task + + /// Create a repository in an organization + [] + [] + abstract CreateOrgRepoDeprecated : + [] org : string * + [] body : CreateRepoOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Get list of organizations + [] + [] + abstract OrgGetAll : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Organization list System.Threading.Tasks.Task + + /// Create an organization + [] + [] + abstract OrgCreate : + [] organization : CreateOrgOption * ?ct : System.Threading.CancellationToken -> + Organization System.Threading.Tasks.Task + + /// Get an organization + [] + [] + abstract OrgGet : + [] org : string * ?ct : System.Threading.CancellationToken -> + Organization System.Threading.Tasks.Task + + /// Delete an organization + [] + [] + abstract OrgDelete : + [] org : string * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit an organization + [] + [] + abstract OrgEdit : + [] org : string * + [] body : EditOrgOption * + ?ct : System.Threading.CancellationToken -> + Organization System.Threading.Tasks.Task + + /// List an organization's webhooks + [] + [] + abstract OrgListHooks : + [] org : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Hook list System.Threading.Tasks.Task + + /// Create a hook + [] + [] + abstract OrgCreateHook : + [] org : string * + [] body : CreateHookOption * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// Get a hook + [] + [] + abstract OrgGetHook : + [] org : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// Delete a hook + [] + [] + abstract OrgDeleteHook : + [] org : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Update a hook + [] + [] + abstract OrgEditHook : + [] org : string * + [] id : int * + [] body : EditHookOption * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// List an organization's labels + [] + [] + abstract OrgListLabels : + [] org : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Label list System.Threading.Tasks.Task + + /// Create a label for an organization + [] + [] + abstract OrgCreateLabel : + [] org : string * + [] body : CreateLabelOption * + ?ct : System.Threading.CancellationToken -> + Label System.Threading.Tasks.Task + + /// Get a single label + [] + [] + abstract OrgGetLabel : + [] org : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Label System.Threading.Tasks.Task + + /// Delete a label + [] + [] + abstract OrgDeleteLabel : + [] org : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Update a label + [] + [] + abstract OrgEditLabel : + [] org : string * + [] id : int * + [] body : EditLabelOption * + ?ct : System.Threading.CancellationToken -> + Label System.Threading.Tasks.Task + + /// List an organization's members + [] + [] + abstract OrgListMembers : + [] org : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check if a user is a member of an organization + [] + [] + abstract OrgIsMember : + [] org : string * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Remove a member from an organization + [] + [] + abstract OrgDeleteMember : + [] org : string * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List an organization's public members + [] + [] + abstract OrgListPublicMembers : + [] org : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check if a user is a public member of an organization + [] + [] + abstract OrgIsPublicMember : + [] org : string * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Conceal a user's membership + [] + [] + abstract OrgConcealMember : + [] org : string * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Publicize a user's membership + [] + [] + abstract OrgPublicizeMember : + [] org : string * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List an organization's repos + [] + [] + abstract OrgListRepos : + [] org : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// Create a repository in an organization + [] + [] + abstract CreateOrgRepo : + [] org : string * + [] body : CreateRepoOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// List an organization's teams + [] + [] + abstract OrgListTeams : + [] org : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Team list System.Threading.Tasks.Task + + /// Create a team + [] + [] + abstract OrgCreateTeam : + [] org : string * + [] body : CreateTeamOption * + ?ct : System.Threading.CancellationToken -> + Team System.Threading.Tasks.Task + + /// Search for teams within an organization + [] + [] + abstract TeamSearch : + [] org : string * + [] q : string * + [] include_desc : bool * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Gets all packages of an owner + [] + [] + abstract ListPackages : + [] owner : string * + [] page : int * + [] limit : int * + [] type' : string * + [] q : string * + ?ct : System.Threading.CancellationToken -> + Package list System.Threading.Tasks.Task + + /// Gets a package + [] + [] + abstract GetPackage : + [] owner : string * + [] type' : string * + [] name : string * + [] version : string * + ?ct : System.Threading.CancellationToken -> + Package System.Threading.Tasks.Task + + /// Delete a package + [] + [] + abstract DeletePackage : + [] owner : string * + [] type' : string * + [] name : string * + [] version : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Gets all files of a package + [] + [] + abstract ListPackageFiles : + [] owner : string * + [] type' : string * + [] name : string * + [] version : string * + ?ct : System.Threading.CancellationToken -> + PackageFile list System.Threading.Tasks.Task + + /// Search for issues across the repositories that the user has access to + [] + [] + abstract IssueSearchIssues : + [] state : string * + [] labels : string * + [] milestones : string * + [] q : string * + [] priority_repo_id : int * + [] type' : string * + [] since : string * + [] before : string * + [] assigned : bool * + [] created : bool * + [] mentioned : bool * + [] review_requested : bool * + [] owner : string * + [] team : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Issue list System.Threading.Tasks.Task + + /// Migrate a remote git repository + [] + [] + abstract RepoMigrate : + [] body : MigrateRepoOptions * ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Search for repositories + [] + [] + abstract RepoSearch : + [] q : string * + [] topic : bool * + [] includeDesc : bool * + [] uid : int * + [] priority_owner_id : int * + [] team_id : int * + [] starredBy : int * + [] private' : bool * + [] is_private : bool * + [] template : bool * + [] archived : bool * + [] mode : string * + [] exclusive : bool * + [] sort : string * + [] order : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + SearchResults System.Threading.Tasks.Task + + /// Get a repository + [] + [] + abstract RepoGet : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Delete a repository + [] + [] + abstract RepoDelete : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a repository's properties. Only fields that are set will be changed. + [] + [] + abstract RepoEdit : + [] owner : string * + [] repo : string * + [] body : EditRepoOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Get an archive of a repository + [] + [] + abstract RepoGetArchive : + [] owner : string * + [] repo : string * + [] archive : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Return all users that have write access and can be assigned to issues + [] + [] + abstract RepoGetAssignees : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// List branch protections for a repository + [] + [] + abstract RepoListBranchProtection : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + BranchProtection list System.Threading.Tasks.Task + + /// Create a branch protections for a repository + [] + [] + abstract RepoCreateBranchProtection : + [] owner : string * + [] repo : string * + [] body : CreateBranchProtectionOption * + ?ct : System.Threading.CancellationToken -> + BranchProtection System.Threading.Tasks.Task + + /// Get a specific branch protection for the repository + [] + [] + abstract RepoGetBranchProtection : + [] owner : string * + [] repo : string * + [] name : string * + ?ct : System.Threading.CancellationToken -> + BranchProtection System.Threading.Tasks.Task + + /// Delete a specific branch protection for the repository + [] + [] + abstract RepoDeleteBranchProtection : + [] owner : string * + [] repo : string * + [] name : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a branch protections for a repository. Only fields that are set will be changed + [] + [] + abstract RepoEditBranchProtection : + [] owner : string * + [] repo : string * + [] name : string * + [] body : EditBranchProtectionOption * + ?ct : System.Threading.CancellationToken -> + BranchProtection System.Threading.Tasks.Task + + /// List a repository's branches + [] + [] + abstract RepoListBranches : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Branch list System.Threading.Tasks.Task + + /// Create a branch + [] + [] + abstract RepoCreateBranch : + [] owner : string * + [] repo : string * + [] body : CreateBranchRepoOption * + ?ct : System.Threading.CancellationToken -> + Branch System.Threading.Tasks.Task + + /// Retrieve a specific branch from a repository, including its effective branch protection + [] + [] + abstract RepoGetBranch : + [] owner : string * + [] repo : string * + [] branch : string * + ?ct : System.Threading.CancellationToken -> + Branch System.Threading.Tasks.Task + + /// Delete a specific branch from a repository + [] + [] + abstract RepoDeleteBranch : + [] owner : string * + [] repo : string * + [] branch : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repository's collaborators + [] + [] + abstract RepoListCollaborators : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check if a user is a collaborator of a repository + [] + [] + abstract RepoCheckCollaborator : + [] owner : string * + [] repo : string * + [] collaborator : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Delete a collaborator from a repository + [] + [] + abstract RepoDeleteCollaborator : + [] owner : string * + [] repo : string * + [] collaborator : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Add a collaborator to a repository + [] + [] + abstract RepoAddCollaborator : + [] owner : string * + [] repo : string * + [] collaborator : string * + [] body : AddCollaboratorOption * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get repository permissions for a user + [] + [] + abstract RepoGetRepoPermissions : + [] owner : string * + [] repo : string * + [] collaborator : string * + ?ct : System.Threading.CancellationToken -> + RepoCollaboratorPermission System.Threading.Tasks.Task + + /// Get a list of all commits from a repository + [] + [] + abstract RepoGetAllCommits : + [] owner : string * + [] repo : string * + [] sha : string * + [] path : string * + [] stat : bool * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Commit list System.Threading.Tasks.Task + + /// Get a commit's combined status, by branch/tag/commit reference + [] + [] + abstract RepoGetCombinedStatusByRef : + [] owner : string * + [] repo : string * + [] ref : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + CombinedStatus System.Threading.Tasks.Task + + /// Get a commit's statuses, by branch/tag/commit reference + [] + [] + abstract RepoListStatusesByRef : + [] owner : string * + [] repo : string * + [] ref : string * + [] sort : string * + [] state : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + CommitStatus list System.Threading.Tasks.Task + + /// Gets the metadata of all the entries of the root dir + [] + [] + abstract RepoGetContentsList : + [] owner : string * + [] repo : string * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + ContentsResponse list System.Threading.Tasks.Task + + /// Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir + [] + [] + abstract RepoGetContents : + [] owner : string * + [] repo : string * + [] filepath : string * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + ContentsResponse System.Threading.Tasks.Task + + /// Create a file in a repository + [] + [] + abstract RepoCreateFile : + [] owner : string * + [] repo : string * + [] filepath : string * + [] body : CreateFileOptions * + ?ct : System.Threading.CancellationToken -> + FileResponse System.Threading.Tasks.Task + + /// Delete a file in a repository + [] + [] + abstract RepoDeleteFile : + [] owner : string * + [] repo : string * + [] filepath : string * + [] body : DeleteFileOptions * + ?ct : System.Threading.CancellationToken -> + FileDeleteResponse System.Threading.Tasks.Task + + /// Update a file in a repository + [] + [] + abstract RepoUpdateFile : + [] owner : string * + [] repo : string * + [] filepath : string * + [] body : UpdateFileOptions * + ?ct : System.Threading.CancellationToken -> + FileResponse System.Threading.Tasks.Task + + /// Apply diff patch to repository + [] + [] + abstract RepoApplyDiffPatch : + [] owner : string * + [] repo : string * + [] body : UpdateFileOptions * + ?ct : System.Threading.CancellationToken -> + FileResponse System.Threading.Tasks.Task + + /// Get the EditorConfig definitions of a file in a repository + [] + [] + abstract RepoGetEditorConfig : + [] owner : string * + [] repo : string * + [] filepath : string * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repository's forks + [] + [] + abstract ListForks : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// Fork a repository + [] + [] + abstract CreateFork : + [] owner : string * + [] repo : string * + [] body : CreateForkOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Gets the blob of a repository. + [] + [] + abstract GetBlob : + [] owner : string * + [] repo : string * + [] sha : string * + ?ct : System.Threading.CancellationToken -> + GitBlobResponse System.Threading.Tasks.Task + + /// Get a single commit from a repository + [] + [] + abstract RepoGetSingleCommit : + [] owner : string * + [] repo : string * + [] sha : string * + ?ct : System.Threading.CancellationToken -> + Commit System.Threading.Tasks.Task + + /// Get a commit's diff or patch + [] + [] + abstract RepoDownloadCommitDiffOrPatch : + [] owner : string * + [] repo : string * + [] sha : string * + [] diffType : string * + ?ct : System.Threading.CancellationToken -> + string System.Threading.Tasks.Task + + /// Get a note corresponding to a single commit from a repository + [] + [] + abstract RepoGetNote : + [] owner : string * + [] repo : string * + [] sha : string * + ?ct : System.Threading.CancellationToken -> + Note System.Threading.Tasks.Task + + /// Get specified ref or filtered repository's refs + [] + [] + abstract RepoListAllGitRefs : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Reference list System.Threading.Tasks.Task + + /// Get specified ref or filtered repository's refs + [] + [] + abstract RepoListGitRefs : + [] owner : string * + [] repo : string * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + Reference list System.Threading.Tasks.Task + + /// Gets the tag object of an annotated tag (not lightweight tags) + [] + [] + abstract GetAnnotatedTag : + [] owner : string * + [] repo : string * + [] sha : string * + ?ct : System.Threading.CancellationToken -> + AnnotatedTag System.Threading.Tasks.Task + + /// Gets the tree of a repository. + [] + [] + abstract GetTree : + [] owner : string * + [] repo : string * + [] sha : string * + [] recursive : bool * + [] page : int * + [] per_page : int * + ?ct : System.Threading.CancellationToken -> + GitTreeResponse System.Threading.Tasks.Task + + /// List the hooks in a repository + [] + [] + abstract RepoListHooks : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Hook list System.Threading.Tasks.Task + + /// Create a hook + [] + [] + abstract RepoCreateHook : + [] owner : string * + [] repo : string * + [] body : CreateHookOption * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// List the Git hooks in a repository + [] + [] + abstract RepoListGitHooks : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + GitHook list System.Threading.Tasks.Task + + /// Get a Git hook + [] + [] + abstract RepoGetGitHook : + [] owner : string * + [] repo : string * + [] id : string * + ?ct : System.Threading.CancellationToken -> + GitHook System.Threading.Tasks.Task + + /// Delete a Git hook in a repository + [] + [] + abstract RepoDeleteGitHook : + [] owner : string * + [] repo : string * + [] id : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a Git hook in a repository + [] + [] + abstract RepoEditGitHook : + [] owner : string * + [] repo : string * + [] id : string * + [] body : EditGitHookOption * + ?ct : System.Threading.CancellationToken -> + GitHook System.Threading.Tasks.Task + + /// Get a hook + [] + [] + abstract RepoGetHook : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// Delete a hook in a repository + [] + [] + abstract RepoDeleteHook : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a hook in a repository + [] + [] + abstract RepoEditHook : + [] owner : string * + [] repo : string * + [] id : int * + [] body : EditHookOption * + ?ct : System.Threading.CancellationToken -> + Hook System.Threading.Tasks.Task + + /// Test a push webhook + [] + [] + abstract RepoTestHook : + [] owner : string * + [] repo : string * + [] id : int * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get available issue templates for a repository + [] + [] + abstract RepoGetIssueTemplates : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + IssueTemplate list System.Threading.Tasks.Task + + /// List a repository's issues + [] + [] + abstract IssueListIssues : + [] owner : string * + [] repo : string * + [] state : string * + [] labels : string * + [] q : string * + [] type' : string * + [] milestones : string * + [] since : string * + [] before : string * + [] created_by : string * + [] assigned_by : string * + [] mentioned_by : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Issue list System.Threading.Tasks.Task + + /// Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + [] + [] + abstract IssueCreateIssue : + [] owner : string * + [] repo : string * + [] body : CreateIssueOption * + ?ct : System.Threading.CancellationToken -> + Issue System.Threading.Tasks.Task + + /// List all comments in a repository + [] + [] + abstract IssueGetRepoComments : + [] owner : string * + [] repo : string * + [] since : string * + [] before : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Comment list System.Threading.Tasks.Task + + /// Delete a comment + [] + [] + abstract IssueDeleteComment : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List comment's attachments + [] + [] + abstract IssueListIssueCommentAttachments : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Attachment list System.Threading.Tasks.Task + + /// Get a comment attachment + [] + [] + abstract IssueGetIssueCommentAttachment : + [] owner : string * + [] repo : string * + [] id : int * + [] attachment_id : int * + ?ct : System.Threading.CancellationToken -> + Attachment System.Threading.Tasks.Task + + /// Delete a comment attachment + [] + [] + abstract IssueDeleteIssueCommentAttachment : + [] owner : string * + [] repo : string * + [] id : int * + [] attachment_id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a comment attachment + [] + [] + abstract IssueEditIssueCommentAttachment : + [] owner : string * + [] repo : string * + [] id : int * + [] attachment_id : int * + [] body : EditAttachmentOptions * + ?ct : System.Threading.CancellationToken -> + Attachment System.Threading.Tasks.Task + + /// Get a list of reactions from a comment of an issue + [] + [] + abstract IssueGetCommentReactions : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Reaction list System.Threading.Tasks.Task + + /// Remove a reaction from a comment of an issue + [] + [] + abstract IssueDeleteCommentReaction : + [] owner : string * + [] repo : string * + [] id : int * + [] content : EditReactionOption * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get an issue + [] + [] + abstract IssueGetIssue : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + Issue System.Threading.Tasks.Task + + /// Delete an issue + [] + [] + abstract IssueDelete : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. + [] + [] + abstract IssueEditIssue : + [] owner : string * + [] repo : string * + [] index : int * + [] body : EditIssueOption * + ?ct : System.Threading.CancellationToken -> + Issue System.Threading.Tasks.Task + + /// List issue's attachments + [] + [] + abstract IssueListIssueAttachments : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + Attachment list System.Threading.Tasks.Task + + /// Get an issue attachment + [] + [] + abstract IssueGetIssueAttachment : + [] owner : string * + [] repo : string * + [] index : int * + [] attachment_id : int * + ?ct : System.Threading.CancellationToken -> + Attachment System.Threading.Tasks.Task + + /// Delete an issue attachment + [] + [] + abstract IssueDeleteIssueAttachment : + [] owner : string * + [] repo : string * + [] index : int * + [] attachment_id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit an issue attachment + [] + [] + abstract IssueEditIssueAttachment : + [] owner : string * + [] repo : string * + [] index : int * + [] attachment_id : int * + [] body : EditAttachmentOptions * + ?ct : System.Threading.CancellationToken -> + Attachment System.Threading.Tasks.Task + + /// List all comments on an issue + [] + [] + abstract IssueGetComments : + [] owner : string * + [] repo : string * + [] index : int * + [] since : string * + [] before : string * + ?ct : System.Threading.CancellationToken -> + Comment list System.Threading.Tasks.Task + + /// Add a comment to an issue + [] + [] + abstract IssueCreateComment : + [] owner : string * + [] repo : string * + [] index : int * + [] body : CreateIssueCommentOption * + ?ct : System.Threading.CancellationToken -> + Comment System.Threading.Tasks.Task + + /// Delete a comment + [] + [] + abstract IssueDeleteCommentDeprecated : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. + [] + [] + abstract IssueEditIssueDeadline : + [] owner : string * + [] repo : string * + [] index : int * + [] body : EditDeadlineOption * + ?ct : System.Threading.CancellationToken -> + IssueDeadline System.Threading.Tasks.Task + + /// Get an issue's labels + [] + [] + abstract IssueGetLabels : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + Label list System.Threading.Tasks.Task + + /// Add a label to an issue + [] + [] + abstract IssueAddLabel : + [] owner : string * + [] repo : string * + [] index : int * + [] body : IssueLabelsOption * + ?ct : System.Threading.CancellationToken -> + Label list System.Threading.Tasks.Task + + /// Remove all labels from an issue + [] + [] + abstract IssueClearLabels : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Replace an issue's labels + [] + [] + abstract IssueReplaceLabels : + [] owner : string * + [] repo : string * + [] index : int * + [] body : IssueLabelsOption * + ?ct : System.Threading.CancellationToken -> + Label list System.Threading.Tasks.Task + + /// Remove a label from an issue + [] + [] + abstract IssueRemoveLabel : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a list reactions of an issue + [] + [] + abstract IssueGetIssueReactions : + [] owner : string * + [] repo : string * + [] index : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Reaction list System.Threading.Tasks.Task + + /// Remove a reaction from an issue + [] + [] + abstract IssueDeleteIssueReaction : + [] owner : string * + [] repo : string * + [] index : int * + [] content : EditReactionOption * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Delete an issue's existing stopwatch. + [] + [] + abstract IssueDeleteStopWatch : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Start stopwatch on an issue. + [] + [] + abstract IssueStartStopWatch : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Stop an issue's existing stopwatch. + [] + [] + abstract IssueStopStopWatch : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get users who subscribed on an issue. + [] + [] + abstract IssueSubscriptions : + [] owner : string * + [] repo : string * + [] index : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check if user is subscribed to an issue + [] + [] + abstract IssueCheckSubscription : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + WatchInfo System.Threading.Tasks.Task + + /// List all comments and events on an issue + [] + [] + abstract IssueGetCommentsAndTimeline : + [] owner : string * + [] repo : string * + [] index : int * + [] since : string * + [] page : int * + [] limit : int * + [] before : string * + ?ct : System.Threading.CancellationToken -> + TimelineComment list System.Threading.Tasks.Task + + /// List an issue's tracked times + [] + [] + abstract IssueTrackedTimes : + [] owner : string * + [] repo : string * + [] index : int * + [] user : string * + [] since : string * + [] before : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + TrackedTime list System.Threading.Tasks.Task + + /// Add tracked time to a issue + [] + [] + abstract IssueAddTime : + [] owner : string * + [] repo : string * + [] index : int * + [] body : AddTimeOption * + ?ct : System.Threading.CancellationToken -> + TrackedTime System.Threading.Tasks.Task + + /// Reset a tracked time of an issue + [] + [] + abstract IssueResetTime : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Delete specific tracked time + [] + [] + abstract IssueDeleteTime : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repository's keys + [] + [] + abstract RepoListKeys : + [] owner : string * + [] repo : string * + [] key_id : int * + [] fingerprint : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + DeployKey list System.Threading.Tasks.Task + + /// Add a key to a repository + [] + [] + abstract RepoCreateKey : + [] owner : string * + [] repo : string * + [] body : CreateKeyOption * + ?ct : System.Threading.CancellationToken -> + DeployKey System.Threading.Tasks.Task + + /// Get a repository's key by id + [] + [] + abstract RepoGetKey : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + DeployKey System.Threading.Tasks.Task + + /// Delete a key from a repository + [] + [] + abstract RepoDeleteKey : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get all of a repository's labels + [] + [] + abstract IssueListLabels : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Label list System.Threading.Tasks.Task + + /// Create a label + [] + [] + abstract IssueCreateLabel : + [] owner : string * + [] repo : string * + [] body : CreateLabelOption * + ?ct : System.Threading.CancellationToken -> + Label System.Threading.Tasks.Task + + /// Get a single label + [] + [] + abstract IssueGetLabel : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Label System.Threading.Tasks.Task + + /// Delete a label + [] + [] + abstract IssueDeleteLabel : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Update a label + [] + [] + abstract IssueEditLabel : + [] owner : string * + [] repo : string * + [] id : int * + [] body : EditLabelOption * + ?ct : System.Threading.CancellationToken -> + Label System.Threading.Tasks.Task + + /// Get languages and number of bytes of code written + [] + [] + abstract RepoGetLanguages : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + LanguageStatistics System.Threading.Tasks.Task + + /// Get a file or it's LFS object from a repository + [] + [] + abstract RepoGetRawFileOrLFS : + [] owner : string * + [] repo : string * + [] filepath : string * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get all of a repository's opened milestones + [] + [] + abstract IssueGetMilestonesList : + [] owner : string * + [] repo : string * + [] state : string * + [] name : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Milestone list System.Threading.Tasks.Task + + /// Create a milestone + [] + [] + abstract IssueCreateMilestone : + [] owner : string * + [] repo : string * + [] body : CreateMilestoneOption * + ?ct : System.Threading.CancellationToken -> + Milestone System.Threading.Tasks.Task + + /// Get a milestone + [] + [] + abstract IssueGetMilestone : + [] owner : string * + [] repo : string * + [] id : string * + ?ct : System.Threading.CancellationToken -> + Milestone System.Threading.Tasks.Task + + /// Delete a milestone + [] + [] + abstract IssueDeleteMilestone : + [] owner : string * + [] repo : string * + [] id : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Update a milestone + [] + [] + abstract IssueEditMilestone : + [] owner : string * + [] repo : string * + [] id : string * + [] body : EditMilestoneOption * + ?ct : System.Threading.CancellationToken -> + Milestone System.Threading.Tasks.Task + + /// Sync a mirrored repository + [] + [] + abstract RepoMirrorSync : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List users's notification threads on a specific repo + [] + [] + abstract NotifyGetRepoList : + [] owner : string * + [] repo : string * + [] all : bool * + [] status_types : string list * + [] subject_type : string list * + [] since : string * + [] before : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + NotificationThread list System.Threading.Tasks.Task + + /// Mark notification threads as read, pinned or unread on a specific repo + [] + [] + abstract NotifyReadRepoList : + [] owner : string * + [] repo : string * + [] all : string * + [] status_types : string list * + [] to_status : string * + [] last_read_at : string * + ?ct : System.Threading.CancellationToken -> + NotificationThread list System.Threading.Tasks.Task + + /// List a repo's pull requests + [] + [] + abstract RepoListPullRequests : + [] owner : string * + [] repo : string * + [] state : string * + [] sort : string * + [] milestone : int * + [] labels : int list * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + PullRequest list System.Threading.Tasks.Task + + /// Create a pull request + [] + [] + abstract RepoCreatePullRequest : + [] owner : string * + [] repo : string * + [] body : CreatePullRequestOption * + ?ct : System.Threading.CancellationToken -> + PullRequest System.Threading.Tasks.Task + + /// Get a pull request + [] + [] + abstract RepoGetPullRequest : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + PullRequest System.Threading.Tasks.Task + + /// Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. + [] + [] + abstract RepoEditPullRequest : + [] owner : string * + [] repo : string * + [] index : int * + [] body : EditPullRequestOption * + ?ct : System.Threading.CancellationToken -> + PullRequest System.Threading.Tasks.Task + + /// Get a pull request diff or patch + [] + [] + abstract RepoDownloadPullDiffOrPatch : + [] owner : string * + [] repo : string * + [] index : int * + [] diffType : string * + [] binary : bool * + ?ct : System.Threading.CancellationToken -> + string System.Threading.Tasks.Task + + /// Get commits for a pull request + [] + [] + abstract RepoGetPullRequestCommits : + [] owner : string * + [] repo : string * + [] index : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Commit list System.Threading.Tasks.Task + + /// Get changed files for a pull request + [] + [] + abstract RepoGetPullRequestFiles : + [] owner : string * + [] repo : string * + [] index : int * + [] skip_to : string * + [] whitespace : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + ChangedFile list System.Threading.Tasks.Task + + /// Check if a pull request has been merged + [] + [] + abstract RepoPullRequestIsMerged : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Merge a pull request + [] + [] + abstract RepoMergePullRequest : + [] owner : string * + [] repo : string * + [] index : int * + [] body : MergePullRequestOption * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Cancel the scheduled auto merge for the given pull request + [] + [] + abstract RepoCancelScheduledAutoMerge : + [] owner : string * + [] repo : string * + [] index : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// create review requests for a pull request + [] + [] + abstract RepoCreatePullReviewRequests : + [] owner : string * + [] repo : string * + [] index : int * + [] body : PullReviewRequestOptions * + ?ct : System.Threading.CancellationToken -> + PullReview list System.Threading.Tasks.Task + + /// cancel review requests for a pull request + [] + [] + abstract RepoDeletePullReviewRequests : + [] owner : string * + [] repo : string * + [] index : int * + [] body : PullReviewRequestOptions * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List all reviews for a pull request + [] + [] + abstract RepoListPullReviews : + [] owner : string * + [] repo : string * + [] index : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + PullReview list System.Threading.Tasks.Task + + /// Create a review to an pull request + [] + [] + abstract RepoCreatePullReview : + [] owner : string * + [] repo : string * + [] index : int * + [] body : CreatePullReviewOptions * + ?ct : System.Threading.CancellationToken -> + PullReview System.Threading.Tasks.Task + + /// Get a specific review for a pull request + [] + [] + abstract RepoGetPullReview : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + PullReview System.Threading.Tasks.Task + + /// Submit a pending review to an pull request + [] + [] + abstract RepoSubmitPullReview : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + [] body : SubmitPullReviewOptions * + ?ct : System.Threading.CancellationToken -> + PullReview System.Threading.Tasks.Task + + /// Delete a specific review from a pull request + [] + [] + abstract RepoDeletePullReview : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a specific review for a pull request + [] + [] + abstract RepoGetPullReviewComments : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + PullReviewComment list System.Threading.Tasks.Task + + /// Dismiss a review for a pull request + [] + [] + abstract RepoDismissPullReview : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + [] body : DismissPullReviewOptions * + ?ct : System.Threading.CancellationToken -> + PullReview System.Threading.Tasks.Task + + /// Cancel to dismiss a review for a pull request + [] + [] + abstract RepoUnDismissPullReview : + [] owner : string * + [] repo : string * + [] index : int * + [] id : int * + ?ct : System.Threading.CancellationToken -> + PullReview System.Threading.Tasks.Task + + /// Merge PR's baseBranch into headBranch + [] + [] + abstract RepoUpdatePullRequest : + [] owner : string * + [] repo : string * + [] index : int * + [] style : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get all push mirrors of the repository + [] + [] + abstract RepoListPushMirrors : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + PushMirror list System.Threading.Tasks.Task + + /// add a push mirror to the repository + [] + [] + abstract RepoAddPushMirror : + [] owner : string * + [] repo : string * + [] body : CreatePushMirrorOption * + ?ct : System.Threading.CancellationToken -> + PushMirror System.Threading.Tasks.Task + + /// Sync all push mirrored repository + [] + [] + abstract RepoPushMirrorSync : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get push mirror of the repository by remoteName + [] + [] + abstract RepoGetPushMirrorByRemoteName : + [] owner : string * + [] repo : string * + [] name : string * + ?ct : System.Threading.CancellationToken -> + PushMirror System.Threading.Tasks.Task + + /// deletes a push mirror from a repository by remoteName + [] + [] + abstract RepoDeletePushMirror : + [] owner : string * + [] repo : string * + [] name : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a file from a repository + [] + [] + abstract RepoGetRawFile : + [] owner : string * + [] repo : string * + [] filepath : string * + [] ref : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repo's releases + [] + [] + abstract RepoListReleases : + [] owner : string * + [] repo : string * + [] draft : bool * + [] pre_release : bool * + [] per_page : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Release list System.Threading.Tasks.Task + + /// Create a release + [] + [] + abstract RepoCreateRelease : + [] owner : string * + [] repo : string * + [] body : CreateReleaseOption * + ?ct : System.Threading.CancellationToken -> + Release System.Threading.Tasks.Task + + /// Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at + [] + [] + abstract RepoGetLatestRelease : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Release System.Threading.Tasks.Task + + /// Get a release by tag name + [] + [] + abstract RepoGetReleaseByTag : + [] owner : string * + [] repo : string * + [] tag : string * + ?ct : System.Threading.CancellationToken -> + Release System.Threading.Tasks.Task + + /// Delete a release by tag name + [] + [] + abstract RepoDeleteReleaseByTag : + [] owner : string * + [] repo : string * + [] tag : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a release + [] + [] + abstract RepoGetRelease : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Release System.Threading.Tasks.Task + + /// Delete a release + [] + [] + abstract RepoDeleteRelease : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Update a release + [] + [] + abstract RepoEditRelease : + [] owner : string * + [] repo : string * + [] id : int * + [] body : EditReleaseOption * + ?ct : System.Threading.CancellationToken -> + Release System.Threading.Tasks.Task + + /// List release's attachments + [] + [] + abstract RepoListReleaseAttachments : + [] owner : string * + [] repo : string * + [] id : int * + ?ct : System.Threading.CancellationToken -> + Attachment list System.Threading.Tasks.Task + + /// Get a release attachment + [] + [] + abstract RepoGetReleaseAttachment : + [] owner : string * + [] repo : string * + [] id : int * + [] attachment_id : int * + ?ct : System.Threading.CancellationToken -> + Attachment System.Threading.Tasks.Task + + /// Delete a release attachment + [] + [] + abstract RepoDeleteReleaseAttachment : + [] owner : string * + [] repo : string * + [] id : int * + [] attachment_id : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a release attachment + [] + [] + abstract RepoEditReleaseAttachment : + [] owner : string * + [] repo : string * + [] id : int * + [] attachment_id : int * + [] body : EditAttachmentOptions * + ?ct : System.Threading.CancellationToken -> + Attachment System.Threading.Tasks.Task + + /// Return all users that can be requested to review in this repo + [] + [] + abstract RepoGetReviewers : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Get signing-key.gpg for given repository + [] + [] + abstract RepoSigningKey : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repo's stargazers + [] + [] + abstract RepoListStargazers : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Get a commit's statuses + [] + [] + abstract RepoListStatuses : + [] owner : string * + [] repo : string * + [] sha : string * + [] sort : string * + [] state : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + CommitStatus list System.Threading.Tasks.Task + + /// Create a commit status + [] + [] + abstract RepoCreateStatus : + [] owner : string * + [] repo : string * + [] sha : string * + [] body : CreateStatusOption * + ?ct : System.Threading.CancellationToken -> + CommitStatus System.Threading.Tasks.Task + + /// List a repo's watchers + [] + [] + abstract RepoListSubscribers : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check if the current user is watching a repo + [] + [] + abstract UserCurrentCheckSubscription : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + WatchInfo System.Threading.Tasks.Task + + /// Unwatch a repo + [] + [] + abstract UserCurrentDeleteSubscription : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Watch a repo + [] + [] + abstract UserCurrentPutSubscription : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + WatchInfo System.Threading.Tasks.Task + + /// List a repository's tags + [] + [] + abstract RepoListTags : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Tag list System.Threading.Tasks.Task + + /// Create a new git tag in a repository + [] + [] + abstract RepoCreateTag : + [] owner : string * + [] repo : string * + [] body : CreateTagOption * + ?ct : System.Threading.CancellationToken -> + Tag System.Threading.Tasks.Task + + /// Get the tag of a repository by tag name + [] + [] + abstract RepoGetTag : + [] owner : string * + [] repo : string * + [] tag : string * + ?ct : System.Threading.CancellationToken -> + Tag System.Threading.Tasks.Task + + /// Delete a repository's tag by name + [] + [] + abstract RepoDeleteTag : + [] owner : string * + [] repo : string * + [] tag : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repository's teams + [] + [] + abstract RepoListTeams : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Team list System.Threading.Tasks.Task + + /// Check if a team is assigned to a repository + [] + [] + abstract RepoCheckTeam : + [] owner : string * + [] repo : string * + [] team : string * + ?ct : System.Threading.CancellationToken -> + Team System.Threading.Tasks.Task + + /// Delete a team from a repository + [] + [] + abstract RepoDeleteTeam : + [] owner : string * + [] repo : string * + [] team : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Add a team to a repository + [] + [] + abstract RepoAddTeam : + [] owner : string * + [] repo : string * + [] team : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a repo's tracked times + [] + [] + abstract RepoTrackedTimes : + [] owner : string * + [] repo : string * + [] user : string * + [] since : string * + [] before : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + TrackedTime list System.Threading.Tasks.Task + + /// List a user's tracked times in a repo + [] + [] + abstract UserTrackedTimes : + [] owner : string * + [] repo : string * + [] user : string * + ?ct : System.Threading.CancellationToken -> + TrackedTime list System.Threading.Tasks.Task + + /// Get list of topics that a repository has + [] + [] + abstract RepoListTopics : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + TopicName System.Threading.Tasks.Task + + /// Replace list of topics for a repository + [] + [] + abstract RepoUpdateTopics : + [] owner : string * + [] repo : string * + [] body : RepoTopicOptions * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Delete a topic from a repository + [] + [] + abstract RepoDeleteTopic : + [] owner : string * + [] repo : string * + [] topic : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Add a topic to a repository + [] + [] + abstract RepoAddTopic : + [] owner : string * + [] repo : string * + [] topic : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Transfer a repo ownership + [] + [] + abstract RepoTransfer : + [] owner : string * + [] repo : string * + [] body : TransferRepoOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Accept a repo transfer + [] + [] + abstract AcceptRepoTransfer : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Reject a repo transfer + [] + [] + abstract RejectRepoTransfer : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Create a wiki page + [] + [] + abstract RepoCreateWikiPage : + [] owner : string * + [] repo : string * + [] body : CreateWikiPageOptions * + ?ct : System.Threading.CancellationToken -> + WikiPage System.Threading.Tasks.Task + + /// Get a wiki page + [] + [] + abstract RepoGetWikiPage : + [] owner : string * + [] repo : string * + [] pageName : string * + ?ct : System.Threading.CancellationToken -> + WikiPage System.Threading.Tasks.Task + + /// Delete a wiki page + [] + [] + abstract RepoDeleteWikiPage : + [] owner : string * + [] repo : string * + [] pageName : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Edit a wiki page + [] + [] + abstract RepoEditWikiPage : + [] owner : string * + [] repo : string * + [] pageName : string * + [] body : CreateWikiPageOptions * + ?ct : System.Threading.CancellationToken -> + WikiPage System.Threading.Tasks.Task + + /// Get all wiki pages + [] + [] + abstract RepoGetWikiPages : + [] owner : string * + [] repo : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + WikiPageMetaData list System.Threading.Tasks.Task + + /// Get revisions of a wiki page + [] + [] + abstract RepoGetWikiPageRevisions : + [] owner : string * + [] repo : string * + [] pageName : string * + [] page : int * + ?ct : System.Threading.CancellationToken -> + WikiCommitList System.Threading.Tasks.Task + + /// Create a repository using a template + [] + [] + abstract GenerateRepo : + [] template_owner : string * + [] template_repo : string * + [] body : GenerateRepoOption * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Get a repository by id + [] + [] + abstract RepoGetByID : + [] id : int * ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Get instance's global settings for api + [] + [] + abstract GetGeneralAPISettings : + ?ct : System.Threading.CancellationToken -> GeneralAPISettings System.Threading.Tasks.Task + + /// Get instance's global settings for Attachment + [] + [] + abstract GetGeneralAttachmentSettings : + ?ct : System.Threading.CancellationToken -> GeneralAttachmentSettings System.Threading.Tasks.Task + + /// Get instance's global settings for repositories + [] + [] + abstract GetGeneralRepositorySettings : + ?ct : System.Threading.CancellationToken -> GeneralRepoSettings System.Threading.Tasks.Task + + /// Get instance's global settings for ui + [] + [] + abstract GetGeneralUISettings : + ?ct : System.Threading.CancellationToken -> GeneralUISettings System.Threading.Tasks.Task + + /// Get default signing-key.gpg + [] + [] + abstract GetSigningKey : ?ct : System.Threading.CancellationToken -> unit System.Threading.Tasks.Task + + /// Get a team + [] + [] + abstract OrgGetTeam : + [] id : int * ?ct : System.Threading.CancellationToken -> Team System.Threading.Tasks.Task + + /// Delete a team + [] + [] + abstract OrgDeleteTeam : + [] id : int * ?ct : System.Threading.CancellationToken -> unit System.Threading.Tasks.Task + + /// Edit a team + [] + [] + abstract OrgEditTeam : + [] id : int * + [] body : EditTeamOption * + ?ct : System.Threading.CancellationToken -> + Team System.Threading.Tasks.Task + + /// List a team's members + [] + [] + abstract OrgListTeamMembers : + [] id : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// List a particular member of team + [] + [] + abstract OrgListTeamMember : + [] id : int * + [] username : string * + ?ct : System.Threading.CancellationToken -> + User System.Threading.Tasks.Task + + /// Remove a team member + [] + [] + abstract OrgRemoveTeamMember : + [] id : int * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Add a team member + [] + [] + abstract OrgAddTeamMember : + [] id : int * + [] username : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List a team's repos + [] + [] + abstract OrgListTeamRepos : + [] id : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// List a particular repo of team + [] + [] + abstract OrgListTeamRepo : + [] id : int * + [] org : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Remove a repository from a team + [] + [] + abstract OrgRemoveTeamRepository : + [] id : int * + [] org : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Add a repository to a team + [] + [] + abstract OrgAddTeamRepository : + [] id : int * + [] org : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// search topics via keyword + [] + [] + abstract TopicSearch : + [] q : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + TopicResponse list System.Threading.Tasks.Task + + /// Get the authenticated user + [] + [] + abstract UserGetCurrent : ?ct : System.Threading.CancellationToken -> User System.Threading.Tasks.Task + + /// List the authenticated user's oauth2 applications + [] + [] + abstract UserGetOauth2Application : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + OAuth2Application list System.Threading.Tasks.Task + + /// creates a new OAuth2 application + [] + [] + abstract UserCreateOAuth2Application : + [] body : CreateOAuth2ApplicationOptions * ?ct : System.Threading.CancellationToken -> + OAuth2Application System.Threading.Tasks.Task + + /// get an OAuth2 Application + [] + [] + abstract UserGetOAuth2Application : + [] id : int * ?ct : System.Threading.CancellationToken -> + OAuth2Application System.Threading.Tasks.Task + + /// delete an OAuth2 Application + [] + [] + abstract UserDeleteOAuth2Application : + [] id : int * ?ct : System.Threading.CancellationToken -> unit System.Threading.Tasks.Task + + /// update an OAuth2 Application, this includes regenerating the client secret + [] + [] + abstract UserUpdateOAuth2Application : + [] id : int * + [] body : CreateOAuth2ApplicationOptions * + ?ct : System.Threading.CancellationToken -> + OAuth2Application System.Threading.Tasks.Task + + /// List the authenticated user's email addresses + [] + [] + abstract UserListEmails : ?ct : System.Threading.CancellationToken -> Email list System.Threading.Tasks.Task + + /// Add email addresses + [] + [] + abstract UserAddEmail : + [] body : CreateEmailOption * ?ct : System.Threading.CancellationToken -> + Email list System.Threading.Tasks.Task + + /// Delete email addresses + [] + [] + abstract UserDeleteEmail : + [] body : DeleteEmailOption * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// List the authenticated user's followers + [] + [] + abstract UserCurrentListFollowers : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// List the users that the authenticated user is following + [] + [] + abstract UserCurrentListFollowing : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check whether a user is followed by the authenticated user + [] + [] + abstract UserCurrentCheckFollowing : + [] username : string * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Unfollow a user + [] + [] + abstract UserCurrentDeleteFollow : + [] username : string * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Follow a user + [] + [] + abstract UserCurrentPutFollow : + [] username : string * ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a Token to verify + [] + [] + abstract GetVerificationToken : ?ct : System.Threading.CancellationToken -> string System.Threading.Tasks.Task + + /// Remove a GPG key + [] + [] + abstract UserCurrentDeleteGPGKey : + [] id : int * ?ct : System.Threading.CancellationToken -> unit System.Threading.Tasks.Task + + /// List the authenticated user's public keys + [] + [] + abstract UserCurrentListKeys : + [] fingerprint : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + PublicKey list System.Threading.Tasks.Task + + /// Create a public key + [] + [] + abstract UserCurrentPostKey : + [] body : CreateKeyOption * ?ct : System.Threading.CancellationToken -> + PublicKey System.Threading.Tasks.Task + + /// Get a public key + [] + [] + abstract UserCurrentGetKey : + [] id : int * ?ct : System.Threading.CancellationToken -> + PublicKey System.Threading.Tasks.Task + + /// Delete a public key + [] + [] + abstract UserCurrentDeleteKey : + [] id : int * ?ct : System.Threading.CancellationToken -> unit System.Threading.Tasks.Task + + /// List the current user's organizations + [] + [] + abstract OrgListCurrentUserOrgs : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Organization list System.Threading.Tasks.Task + + /// List the repos that the authenticated user owns + [] + [] + abstract UserCurrentListRepos : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// Create a repository + [] + [] + abstract CreateCurrentUserRepo : + [] body : CreateRepoOption * ?ct : System.Threading.CancellationToken -> + Repository System.Threading.Tasks.Task + + /// Get user settings + [] + [] + abstract GetUserSettings : ?ct : System.Threading.CancellationToken -> UserSettings list System.Threading.Tasks.Task + + /// Update user settings + [] + [] + abstract UpdateUserSettings : + [] body : UserSettingsOptions * ?ct : System.Threading.CancellationToken -> + UserSettings list System.Threading.Tasks.Task + + /// The repos that the authenticated user has starred + [] + [] + abstract UserCurrentListStarred : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// Whether the authenticated is starring the repo + [] + [] + abstract UserCurrentCheckStarring : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Unstar the given repo + [] + [] + abstract UserCurrentDeleteStar : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Star the given repo + [] + [] + abstract UserCurrentPutStar : + [] owner : string * + [] repo : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get list of all existing stopwatches + [] + [] + abstract UserGetStopWatches : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + StopWatch list System.Threading.Tasks.Task + + /// List repositories watched by the authenticated user + [] + [] + abstract UserCurrentListSubscriptions : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// List all the teams a user belongs to + [] + [] + abstract UserListTeams : + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Team list System.Threading.Tasks.Task + + /// List the current user's tracked times + [] + [] + abstract UserCurrentTrackedTimes : + [] page : int * + [] limit : int * + [] since : string * + [] before : string * + ?ct : System.Threading.CancellationToken -> + TrackedTime list System.Threading.Tasks.Task + + /// Search for users + [] + [] + abstract UserSearch : + [] q : string * + [] uid : int * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a user + [] + [] + abstract UserGet : + [] username : string * ?ct : System.Threading.CancellationToken -> + User System.Threading.Tasks.Task + + /// List the given user's followers + [] + [] + abstract UserListFollowers : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// List the users that the given user is following + [] + [] + abstract UserListFollowing : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + User list System.Threading.Tasks.Task + + /// Check if one user is following another user + [] + [] + abstract UserCheckFollowing : + [] username : string * + [] target : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Get a user's heatmap + [] + [] + abstract UserGetHeatmapData : + [] username : string * ?ct : System.Threading.CancellationToken -> + UserHeatmapData list System.Threading.Tasks.Task + + /// List the given user's public keys + [] + [] + abstract UserListKeys : + [] username : string * + [] fingerprint : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + PublicKey list System.Threading.Tasks.Task + + /// List a user's organizations + [] + [] + abstract OrgListUserOrgs : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Organization list System.Threading.Tasks.Task + + /// Get user permissions in organization + [] + [] + abstract OrgGetUserPermissions : + [] username : string * + [] org : string * + ?ct : System.Threading.CancellationToken -> + OrganizationPermissions System.Threading.Tasks.Task + + /// List the repos owned by the given user + [] + [] + abstract UserListRepos : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// The repos that the given user has starred + [] + [] + abstract UserListStarred : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// List the repositories watched by a user + [] + [] + abstract UserListSubscriptions : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + Repository list System.Threading.Tasks.Task + + /// List the authenticated user's access tokens + [] + [] + abstract UserGetTokens : + [] username : string * + [] page : int * + [] limit : int * + ?ct : System.Threading.CancellationToken -> + AccessToken list System.Threading.Tasks.Task + + /// Create an access token + [] + [] + abstract UserCreateToken : + [] username : string * + [] body : CreateAccessTokenOption * + ?ct : System.Threading.CancellationToken -> + AccessToken System.Threading.Tasks.Task + + /// delete an access token + [] + [] + abstract UserDeleteAccessToken : + [] username : string * + [] token : string * + ?ct : System.Threading.CancellationToken -> + unit System.Threading.Tasks.Task + + /// Returns the version of the Gitea application + [] + [] + abstract GetVersion : ?ct : System.Threading.CancellationToken -> ServerVersion System.Threading.Tasks.Task diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGiteaHttpClient.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGiteaHttpClient.fs new file mode 100644 index 0000000..fc99527 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGiteaHttpClient.fs @@ -0,0 +1,16057 @@ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Extension methods for constructing a REST client. +[] +module GiteaHttpClientExtension = + /// Extension methods for HTTP clients + type IGitea with + + /// Create a REST client. + static member make (client : System.Net.Http.HttpClient) : IGitea = + { new IGitea with + member _.ActivitypubPerson (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "activitypub/user/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return ActivityPub.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.ActivitypubPersonInbox (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "activitypub/user/{username}/inbox" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCronList (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("admin/cron" + + (if "admin/cron".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Cron.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCronRun (task : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/cron/{task}" + .Replace ("{task}", task.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminListHooks (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("admin/hooks" + + (if "admin/hooks".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Hook.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCreateHook (body : CreateHookOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("admin/hooks", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminGetHook (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/hooks/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminEditHook + (id : int, body : EditHookOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/hooks/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminGetAllOrgs (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("admin/orgs" + + (if "admin/orgs".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Organization.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminUnadoptedList + (page : int, limit : int, pattern : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("admin/unadopted" + + (if "admin/unadopted".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString) + + "&pattern=" + + ((pattern.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminAdoptRepository + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/unadopted/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminDeleteUnadoptedRepository + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/unadopted/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminGetAllUsers (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("admin/users" + + (if "admin/users".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCreateUser (body : CreateUserOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("admin/users", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateUserOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return User.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminDeleteUser + (username : string, purge : bool, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("admin/users/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "admin/users/{username}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "purge=" + + ((purge.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminEditUser + (username : string, body : EditUserOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/users/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditUserOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return User.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCreatePublicKey + (username : string, key : CreateKeyOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/users/{username}/keys" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + key + |> CreateKeyOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PublicKey.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminDeleteUserPublicKey + (username : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/users/{username}/keys/{id}" + .Replace("{username}", username.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCreateOrg + (username : string, organization : CreateOrgOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/users/{username}/orgs" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + organization + |> CreateOrgOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Organization.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminCreateRepo + (username : string, repository : CreateRepoOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "admin/users/{username}/repos" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + repository + |> CreateRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AdminDeleteHook (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "amdin/hooks/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RenderMarkdown (body : MarkdownOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("markdown", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> MarkdownOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "text/html" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseString = response.Content.ReadAsStringAsync ct |> Async.AwaitTask + return responseString + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RenderMarkdownRaw (body : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("markdown/raw", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = new System.Net.Http.StringContent (body, null, "text/html") + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseString = response.Content.ReadAsStringAsync ct |> Async.AwaitTask + return responseString + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetNodeInfo (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("nodeinfo", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return NodeInfo.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyGetList + ( + all : bool, + status_types : string list, + subject_type : string list, + since : string, + before : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("notifications" + + (if "notifications".IndexOf (char 63) >= 0 then "&" else "?") + + "all=" + + ((all.ToString ()) |> System.Uri.EscapeDataString) + + "&status-types=" + + ((status_types.ToString ()) |> System.Uri.EscapeDataString) + + "&subject-type=" + + ((subject_type.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> NotificationThread.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyReadList + ( + last_read_at : string, + all : string, + status_types : string list, + to_status : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("notifications" + + (if "notifications".IndexOf (char 63) >= 0 then "&" else "?") + + "last_read_at=" + + ((last_read_at.ToString ()) |> System.Uri.EscapeDataString) + + "&all=" + + ((all.ToString ()) |> System.Uri.EscapeDataString) + + "&status-types=" + + ((status_types.ToString ()) |> System.Uri.EscapeDataString) + + "&to-status=" + + ((to_status.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> NotificationThread.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyNewAvailable (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("notifications/new", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return NotificationCount.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyGetThread (id : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "notifications/threads/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return NotificationThread.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyReadThread + (id : string, to_status : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("notifications/threads/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString) + + (if "notifications/threads/{id}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "to-status=" + + ((to_status.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return NotificationThread.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.CreateOrgRepoDeprecated + (org : string, body : CreateRepoOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "org/{org}/repos" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgGetAll (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs" + + (if "orgs".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Organization.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgCreate (organization : CreateOrgOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("orgs", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + organization + |> CreateOrgOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Organization.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgGet (org : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}".Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Organization.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgDelete (org : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}".Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgEdit (org : string, body : EditOrgOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}".Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditOrgOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Organization.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListHooks + (org : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/hooks" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/hooks".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Hook.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgCreateHook + (org : string, body : CreateHookOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/hooks" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgGetHook (org : string, id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/hooks/{id}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgDeleteHook (org : string, id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/hooks/{id}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgEditHook + (org : string, id : int, body : EditHookOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/hooks/{id}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListLabels + (org : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/labels" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/labels".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgCreateLabel + (org : string, body : CreateLabelOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/labels" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateLabelOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Label.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgGetLabel (org : string, id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/labels/{id}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Label.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgDeleteLabel (org : string, id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/labels/{id}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgEditLabel + (org : string, id : int, body : EditLabelOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/labels/{id}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditLabelOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Label.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListMembers + (org : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/members" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/members".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgIsMember (org : string, username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/members/{username}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgDeleteMember + (org : string, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/members/{username}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListPublicMembers + (org : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/public_members" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/public_members".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgIsPublicMember + (org : string, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/public_members/{username}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgConcealMember + (org : string, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/public_members/{username}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgPublicizeMember + (org : string, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/public_members/{username}" + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListRepos + (org : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/repos" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/repos".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.CreateOrgRepo + (org : string, body : CreateRepoOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/repos" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListTeams + (org : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/teams" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/teams".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Team.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgCreateTeam + (org : string, body : CreateTeamOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "orgs/{org}/teams" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateTeamOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Team.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.TeamSearch + ( + org : string, + q : string, + include_desc : bool, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("orgs/{org}/teams/search" + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString) + + (if "orgs/{org}/teams/search".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString) + + "&include_desc=" + + ((include_desc.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.ListPackages + ( + owner : string, + page : int, + limit : int, + type' : string, + q : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("packages/{owner}" + .Replace ("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + + (if "packages/{owner}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString) + + "&type=" + + ((type'.ToString ()) |> System.Uri.EscapeDataString) + + "&q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Package.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetPackage + ( + owner : string, + type' : string, + name : string, + version : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "packages/{owner}/{type}/{name}/{version}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{type}", type'.ToString () |> System.Uri.EscapeDataString) + .Replace("{name}", name.ToString () |> System.Uri.EscapeDataString) + .Replace ("{version}", version.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Package.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.DeletePackage + ( + owner : string, + type' : string, + name : string, + version : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "packages/{owner}/{type}/{name}/{version}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{type}", type'.ToString () |> System.Uri.EscapeDataString) + .Replace("{name}", name.ToString () |> System.Uri.EscapeDataString) + .Replace ("{version}", version.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.ListPackageFiles + ( + owner : string, + type' : string, + name : string, + version : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "packages/{owner}/{type}/{name}/{version}/files" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{type}", type'.ToString () |> System.Uri.EscapeDataString) + .Replace("{name}", name.ToString () |> System.Uri.EscapeDataString) + .Replace ("{version}", version.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PackageFile.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueSearchIssues + ( + state : string, + labels : string, + milestones : string, + q : string, + priority_repo_id : int, + type' : string, + since : string, + before : string, + assigned : bool, + created : bool, + mentioned : bool, + review_requested : bool, + owner : string, + team : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/issues/search" + + (if "repos/issues/search".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "state=" + + ((state.ToString ()) |> System.Uri.EscapeDataString) + + "&labels=" + + ((labels.ToString ()) |> System.Uri.EscapeDataString) + + "&milestones=" + + ((milestones.ToString ()) |> System.Uri.EscapeDataString) + + "&q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString) + + "&priority_repo_id=" + + ((priority_repo_id.ToString ()) |> System.Uri.EscapeDataString) + + "&type=" + + ((type'.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&assigned=" + + ((assigned.ToString ()) |> System.Uri.EscapeDataString) + + "&created=" + + ((created.ToString ()) |> System.Uri.EscapeDataString) + + "&mentioned=" + + ((mentioned.ToString ()) |> System.Uri.EscapeDataString) + + "&review_requested=" + + ((review_requested.ToString ()) |> System.Uri.EscapeDataString) + + "&owner=" + + ((owner.ToString ()) |> System.Uri.EscapeDataString) + + "&team=" + + ((team.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Issue.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoMigrate (body : MigrateRepoOptions, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("repos/migrate", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> MigrateRepoOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoSearch + ( + q : string, + topic : bool, + includeDesc : bool, + uid : int, + priority_owner_id : int, + team_id : int, + starredBy : int, + private' : bool, + is_private : bool, + template : bool, + archived : bool, + mode : string, + exclusive : bool, + sort : string, + order : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/search" + + (if "repos/search".IndexOf (char 63) >= 0 then "&" else "?") + + "q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString) + + "&topic=" + + ((topic.ToString ()) |> System.Uri.EscapeDataString) + + "&includeDesc=" + + ((includeDesc.ToString ()) |> System.Uri.EscapeDataString) + + "&uid=" + + ((uid.ToString ()) |> System.Uri.EscapeDataString) + + "&priority_owner_id=" + + ((priority_owner_id.ToString ()) |> System.Uri.EscapeDataString) + + "&team_id=" + + ((team_id.ToString ()) |> System.Uri.EscapeDataString) + + "&starredBy=" + + ((starredBy.ToString ()) |> System.Uri.EscapeDataString) + + "&private=" + + ((private'.ToString ()) |> System.Uri.EscapeDataString) + + "&is_private=" + + ((is_private.ToString ()) |> System.Uri.EscapeDataString) + + "&template=" + + ((template.ToString ()) |> System.Uri.EscapeDataString) + + "&archived=" + + ((archived.ToString ()) |> System.Uri.EscapeDataString) + + "&mode=" + + ((mode.ToString ()) |> System.Uri.EscapeDataString) + + "&exclusive=" + + ((exclusive.ToString ()) |> System.Uri.EscapeDataString) + + "&sort=" + + ((sort.ToString ()) |> System.Uri.EscapeDataString) + + "&order=" + + ((order.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return SearchResults.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGet (owner : string, repo : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDelete (owner : string, repo : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEdit + ( + owner : string, + repo : string, + body : EditRepoOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetArchive + (owner : string, repo : string, archive : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/archive/{archive}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{archive}", archive.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetAssignees + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/assignees" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListBranchProtection + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branch_protections" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> BranchProtection.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateBranchProtection + ( + owner : string, + repo : string, + body : CreateBranchProtectionOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branch_protections" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateBranchProtectionOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return BranchProtection.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetBranchProtection + (owner : string, repo : string, name : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branch_protections/{name}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{name}", name.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return BranchProtection.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteBranchProtection + (owner : string, repo : string, name : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branch_protections/{name}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{name}", name.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditBranchProtection + ( + owner : string, + repo : string, + name : string, + body : EditBranchProtectionOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branch_protections/{name}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{name}", name.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditBranchProtectionOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return BranchProtection.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListBranches + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/branches" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/branches".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Branch.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateBranch + ( + owner : string, + repo : string, + body : CreateBranchRepoOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branches" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateBranchRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Branch.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetBranch + (owner : string, repo : string, branch : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branches/{branch}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{branch}", branch.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Branch.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteBranch + (owner : string, repo : string, branch : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/branches/{branch}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{branch}", branch.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListCollaborators + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/collaborators" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/collaborators".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCheckCollaborator + ( + owner : string, + repo : string, + collaborator : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/collaborators/{collaborator}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{collaborator}", + collaborator.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteCollaborator + ( + owner : string, + repo : string, + collaborator : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/collaborators/{collaborator}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{collaborator}", + collaborator.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoAddCollaborator + ( + owner : string, + repo : string, + collaborator : string, + body : AddCollaboratorOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/collaborators/{collaborator}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{collaborator}", + collaborator.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> AddCollaboratorOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetRepoPermissions + ( + owner : string, + repo : string, + collaborator : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/collaborators/{collaborator}/permission" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{collaborator}", + collaborator.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return RepoCollaboratorPermission.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetAllCommits + ( + owner : string, + repo : string, + sha : string, + path : string, + stat : bool, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/commits" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/commits".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "sha=" + + ((sha.ToString ()) |> System.Uri.EscapeDataString) + + "&path=" + + ((path.ToString ()) |> System.Uri.EscapeDataString) + + "&stat=" + + ((stat.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Commit.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetCombinedStatusByRef + ( + owner : string, + repo : string, + ref : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/commits/{ref}/status" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{ref}", ref.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/commits/{ref}/status".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return CombinedStatus.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListStatusesByRef + ( + owner : string, + repo : string, + ref : string, + sort : string, + state : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/commits/{ref}/statuses" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{ref}", ref.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/commits/{ref}/statuses".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "sort=" + + ((sort.ToString ()) |> System.Uri.EscapeDataString) + + "&state=" + + ((state.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> CommitStatus.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetContentsList + (owner : string, repo : string, ref : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/contents" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/contents".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "ref=" + + ((ref.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> ContentsResponse.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetContents + ( + owner : string, + repo : string, + filepath : string, + ref : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/contents/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/contents/{filepath}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "ref=" + + ((ref.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return ContentsResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateFile + ( + owner : string, + repo : string, + filepath : string, + body : CreateFileOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/contents/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateFileOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return FileResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteFile + ( + owner : string, + repo : string, + filepath : string, + body : DeleteFileOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/contents/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> DeleteFileOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return FileDeleteResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoUpdateFile + ( + owner : string, + repo : string, + filepath : string, + body : UpdateFileOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/contents/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> UpdateFileOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return FileResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoApplyDiffPatch + ( + owner : string, + repo : string, + body : UpdateFileOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/diffpatch" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> UpdateFileOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return FileResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetEditorConfig + ( + owner : string, + repo : string, + filepath : string, + ref : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/editorconfig/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/editorconfig/{filepath}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "ref=" + + ((ref.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.ListForks + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/forks" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/forks".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.CreateFork + ( + owner : string, + repo : string, + body : CreateForkOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/forks" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateForkOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetBlob + (owner : string, repo : string, sha : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/blobs/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GitBlobResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetSingleCommit + (owner : string, repo : string, sha : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/commits/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Commit.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDownloadCommitDiffOrPatch + ( + owner : string, + repo : string, + sha : string, + diffType : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/commits/{sha}.{diffType}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{sha}", sha.ToString () |> System.Uri.EscapeDataString) + .Replace ("{diffType}", diffType.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseString = response.Content.ReadAsStringAsync ct |> Async.AwaitTask + return responseString + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetNote + (owner : string, repo : string, sha : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/notes/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Note.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListAllGitRefs + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/refs" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Reference.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListGitRefs + (owner : string, repo : string, ref : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/refs/{ref}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{ref}", ref.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Reference.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetAnnotatedTag + (owner : string, repo : string, sha : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/git/tags/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return AnnotatedTag.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetTree + ( + owner : string, + repo : string, + sha : string, + recursive : bool, + page : int, + per_page : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/git/trees/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/git/trees/{sha}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "recursive=" + + ((recursive.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&per_page=" + + ((per_page.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GitTreeResponse.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListHooks + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/hooks" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/hooks".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Hook.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateHook + ( + owner : string, + repo : string, + body : CreateHookOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListGitHooks + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/git" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> GitHook.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetGitHook + (owner : string, repo : string, id : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/git/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GitHook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteGitHook + (owner : string, repo : string, id : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/git/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditGitHook + ( + owner : string, + repo : string, + id : string, + body : EditGitHookOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/git/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditGitHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GitHook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetHook + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteHook + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditHook + ( + owner : string, + repo : string, + id : int, + body : EditHookOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/hooks/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditHookOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Hook.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoTestHook + ( + owner : string, + repo : string, + id : int, + ref : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/hooks/{id}/tests" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/hooks/{id}/tests".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "ref=" + + ((ref.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetIssueTemplates + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issue_templates" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> IssueTemplate.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueListIssues + ( + owner : string, + repo : string, + state : string, + labels : string, + q : string, + type' : string, + milestones : string, + since : string, + before : string, + created_by : string, + assigned_by : string, + mentioned_by : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/issues".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "state=" + + ((state.ToString ()) |> System.Uri.EscapeDataString) + + "&labels=" + + ((labels.ToString ()) |> System.Uri.EscapeDataString) + + "&q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString) + + "&type=" + + ((type'.ToString ()) |> System.Uri.EscapeDataString) + + "&milestones=" + + ((milestones.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&created_by=" + + ((created_by.ToString ()) |> System.Uri.EscapeDataString) + + "&assigned_by=" + + ((assigned_by.ToString ()) |> System.Uri.EscapeDataString) + + "&mentioned_by=" + + ((mentioned_by.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Issue.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueCreateIssue + ( + owner : string, + repo : string, + body : CreateIssueOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateIssueOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Issue.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetRepoComments + ( + owner : string, + repo : string, + since : string, + before : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues/comments" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/issues/comments".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Comment.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteComment + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueListIssueCommentAttachments + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}/assets" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Attachment.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetIssueCommentAttachment + ( + owner : string, + repo : string, + id : int, + attachment_id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Attachment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteIssueCommentAttachment + ( + owner : string, + repo : string, + id : int, + attachment_id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueEditIssueCommentAttachment + ( + owner : string, + repo : string, + id : int, + attachment_id : int, + body : EditAttachmentOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditAttachmentOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Attachment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetCommentReactions + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}/reactions" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Reaction.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteCommentReaction + ( + owner : string, + repo : string, + id : int, + content : EditReactionOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/comments/{id}/reactions" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + content + |> EditReactionOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetIssue + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Issue.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDelete + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueEditIssue + ( + owner : string, + repo : string, + index : int, + body : EditIssueOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditIssueOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Issue.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueListIssueAttachments + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/assets" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Attachment.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetIssueAttachment + ( + owner : string, + repo : string, + index : int, + attachment_id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Attachment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteIssueAttachment + ( + owner : string, + repo : string, + index : int, + attachment_id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueEditIssueAttachment + ( + owner : string, + repo : string, + index : int, + attachment_id : int, + body : EditAttachmentOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditAttachmentOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Attachment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetComments + ( + owner : string, + repo : string, + index : int, + since : string, + before : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues/{index}/comments" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/issues/{index}/comments".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Comment.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueCreateComment + ( + owner : string, + repo : string, + index : int, + body : CreateIssueCommentOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/comments" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateIssueCommentOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Comment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteCommentDeprecated + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/comments/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueEditIssueDeadline + ( + owner : string, + repo : string, + index : int, + body : EditDeadlineOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/deadline" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditDeadlineOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return IssueDeadline.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetLabels + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/labels" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueAddLabel + ( + owner : string, + repo : string, + index : int, + body : IssueLabelsOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/labels" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> IssueLabelsOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueClearLabels + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/labels" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueReplaceLabels + ( + owner : string, + repo : string, + index : int, + body : IssueLabelsOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/labels" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> IssueLabelsOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueRemoveLabel + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/labels/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetIssueReactions + ( + owner : string, + repo : string, + index : int, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues/{index}/reactions" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/issues/{index}/reactions".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Reaction.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteIssueReaction + ( + owner : string, + repo : string, + index : int, + content : EditReactionOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/reactions" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + content + |> EditReactionOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteStopWatch + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/stopwatch/delete" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueStartStopWatch + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/stopwatch/start" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueStopStopWatch + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/stopwatch/stop" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueSubscriptions + ( + owner : string, + repo : string, + index : int, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues/{index}/subscriptions" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if + "repos/{owner}/{repo}/issues/{index}/subscriptions".IndexOf (char 63) >= 0 + then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueCheckSubscription + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/subscriptions/check" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WatchInfo.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetCommentsAndTimeline + ( + owner : string, + repo : string, + index : int, + since : string, + page : int, + limit : int, + before : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues/{index}/timeline" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/issues/{index}/timeline".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> TimelineComment.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueTrackedTimes + ( + owner : string, + repo : string, + index : int, + user : string, + since : string, + before : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/issues/{index}/times" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/issues/{index}/times".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "user=" + + ((user.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> TrackedTime.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueAddTime + ( + owner : string, + repo : string, + index : int, + body : AddTimeOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/times" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> AddTimeOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return TrackedTime.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueResetTime + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/times" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteTime + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/issues/{index}/times/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListKeys + ( + owner : string, + repo : string, + key_id : int, + fingerprint : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/keys" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/keys".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "key_id=" + + ((key_id.ToString ()) |> System.Uri.EscapeDataString) + + "&fingerprint=" + + ((fingerprint.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> DeployKey.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateKey + ( + owner : string, + repo : string, + body : CreateKeyOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/keys" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateKeyOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return DeployKey.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetKey + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/keys/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return DeployKey.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteKey + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/keys/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueListLabels + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/labels" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/labels".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueCreateLabel + ( + owner : string, + repo : string, + body : CreateLabelOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/labels" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateLabelOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Label.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetLabel + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/labels/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Label.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteLabel + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/labels/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueEditLabel + ( + owner : string, + repo : string, + id : int, + body : EditLabelOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/labels/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditLabelOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Label.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetLanguages + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/languages" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return LanguageStatistics.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetRawFileOrLFS + ( + owner : string, + repo : string, + filepath : string, + ref : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/media/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/media/{filepath}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "ref=" + + ((ref.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetMilestonesList + ( + owner : string, + repo : string, + state : string, + name : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/milestones" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/milestones".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "state=" + + ((state.ToString ()) |> System.Uri.EscapeDataString) + + "&name=" + + ((name.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Milestone.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueCreateMilestone + ( + owner : string, + repo : string, + body : CreateMilestoneOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/milestones" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateMilestoneOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Milestone.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueGetMilestone + (owner : string, repo : string, id : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/milestones/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Milestone.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueDeleteMilestone + (owner : string, repo : string, id : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/milestones/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.IssueEditMilestone + ( + owner : string, + repo : string, + id : string, + body : EditMilestoneOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/milestones/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditMilestoneOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Milestone.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoMirrorSync + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/mirror-sync" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyGetRepoList + ( + owner : string, + repo : string, + all : bool, + status_types : string list, + subject_type : string list, + since : string, + before : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/notifications" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/notifications".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "all=" + + ((all.ToString ()) |> System.Uri.EscapeDataString) + + "&status-types=" + + ((status_types.ToString ()) |> System.Uri.EscapeDataString) + + "&subject-type=" + + ((subject_type.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> NotificationThread.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.NotifyReadRepoList + ( + owner : string, + repo : string, + all : string, + status_types : string list, + to_status : string, + last_read_at : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/notifications" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/notifications".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "all=" + + ((all.ToString ()) |> System.Uri.EscapeDataString) + + "&status-types=" + + ((status_types.ToString ()) |> System.Uri.EscapeDataString) + + "&to-status=" + + ((to_status.ToString ()) |> System.Uri.EscapeDataString) + + "&last_read_at=" + + ((last_read_at.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> NotificationThread.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListPullRequests + ( + owner : string, + repo : string, + state : string, + sort : string, + milestone : int, + labels : int list, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/pulls" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/pulls".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "state=" + + ((state.ToString ()) |> System.Uri.EscapeDataString) + + "&sort=" + + ((sort.ToString ()) |> System.Uri.EscapeDataString) + + "&milestone=" + + ((milestone.ToString ()) |> System.Uri.EscapeDataString) + + "&labels=" + + ((labels.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PullRequest.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreatePullRequest + ( + owner : string, + repo : string, + body : CreatePullRequestOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreatePullRequestOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullRequest.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetPullRequest + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullRequest.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditPullRequest + ( + owner : string, + repo : string, + index : int, + body : EditPullRequestOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditPullRequestOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullRequest.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDownloadPullDiffOrPatch + ( + owner : string, + repo : string, + index : int, + diffType : string, + binary : bool, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/pulls/{index}.{diffType}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{diffType}", diffType.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/pulls/{index}.{diffType}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "binary=" + + ((binary.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseString = response.Content.ReadAsStringAsync ct |> Async.AwaitTask + return responseString + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetPullRequestCommits + ( + owner : string, + repo : string, + index : int, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/pulls/{index}/commits" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/pulls/{index}/commits".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Commit.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetPullRequestFiles + ( + owner : string, + repo : string, + index : int, + skip_to : string, + whitespace : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/pulls/{index}/files" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/pulls/{index}/files".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "skip-to=" + + ((skip_to.ToString ()) |> System.Uri.EscapeDataString) + + "&whitespace=" + + ((whitespace.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> ChangedFile.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoPullRequestIsMerged + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/merge" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoMergePullRequest + ( + owner : string, + repo : string, + index : int, + body : MergePullRequestOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/merge" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> MergePullRequestOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCancelScheduledAutoMerge + (owner : string, repo : string, index : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/merge" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreatePullReviewRequests + ( + owner : string, + repo : string, + index : int, + body : PullReviewRequestOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/requested_reviewers" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> PullReviewRequestOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PullReview.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeletePullReviewRequests + ( + owner : string, + repo : string, + index : int, + body : PullReviewRequestOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/requested_reviewers" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> PullReviewRequestOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListPullReviews + ( + owner : string, + repo : string, + index : int, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/pulls/{index}/reviews" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/pulls/{index}/reviews".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PullReview.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreatePullReview + ( + owner : string, + repo : string, + index : int, + body : CreatePullReviewOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreatePullReviewOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullReview.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetPullReview + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullReview.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoSubmitPullReview + ( + owner : string, + repo : string, + index : int, + id : int, + body : SubmitPullReviewOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> SubmitPullReviewOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullReview.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeletePullReview + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetPullReviewComments + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PullReviewComment.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDismissPullReview + ( + owner : string, + repo : string, + index : int, + id : int, + body : DismissPullReviewOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> DismissPullReviewOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullReview.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoUnDismissPullReview + ( + owner : string, + repo : string, + index : int, + id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{index}", index.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PullReview.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoUpdatePullRequest + ( + owner : string, + repo : string, + index : int, + style : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/pulls/{index}/update" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{index}", index.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/pulls/{index}/update".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "style=" + + ((style.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListPushMirrors + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/push_mirrors" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/push_mirrors".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PushMirror.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoAddPushMirror + ( + owner : string, + repo : string, + body : CreatePushMirrorOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/push_mirrors" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreatePushMirrorOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PushMirror.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoPushMirrorSync + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/push_mirrors-sync" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetPushMirrorByRemoteName + (owner : string, repo : string, name : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/push_mirrors/{name}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{name}", name.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PushMirror.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeletePushMirror + (owner : string, repo : string, name : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/push_mirrors/{name}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{name}", name.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetRawFile + ( + owner : string, + repo : string, + filepath : string, + ref : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/raw/{filepath}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{filepath}", filepath.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/raw/{filepath}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "ref=" + + ((ref.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListReleases + ( + owner : string, + repo : string, + draft : bool, + pre_release : bool, + per_page : int, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/releases" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/releases".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "draft=" + + ((draft.ToString ()) |> System.Uri.EscapeDataString) + + "&pre-release=" + + ((pre_release.ToString ()) |> System.Uri.EscapeDataString) + + "&per_page=" + + ((per_page.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Release.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateRelease + ( + owner : string, + repo : string, + body : CreateReleaseOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateReleaseOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Release.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetLatestRelease + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/latest" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Release.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetReleaseByTag + (owner : string, repo : string, tag : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/tags/{tag}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{tag}", tag.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Release.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteReleaseByTag + (owner : string, repo : string, tag : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/tags/{tag}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{tag}", tag.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetRelease + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Release.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteRelease + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditRelease + ( + owner : string, + repo : string, + id : int, + body : EditReleaseOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditReleaseOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Release.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListReleaseAttachments + (owner : string, repo : string, id : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}/assets" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Attachment.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetReleaseAttachment + ( + owner : string, + repo : string, + id : int, + attachment_id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Attachment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteReleaseAttachment + ( + owner : string, + repo : string, + id : int, + attachment_id : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditReleaseAttachment + ( + owner : string, + repo : string, + id : int, + attachment_id : int, + body : EditAttachmentOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ( + "{attachment_id}", + attachment_id.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditAttachmentOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Attachment.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetReviewers + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/reviewers" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoSigningKey + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/signing-key.gpg" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListStargazers + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/stargazers" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/stargazers".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListStatuses + ( + owner : string, + repo : string, + sha : string, + sort : string, + state : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/statuses/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/statuses/{sha}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "sort=" + + ((sort.ToString ()) |> System.Uri.EscapeDataString) + + "&state=" + + ((state.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> CommitStatus.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateStatus + ( + owner : string, + repo : string, + sha : string, + body : CreateStatusOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/statuses/{sha}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{sha}", sha.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateStatusOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return CommitStatus.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListSubscribers + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/subscribers" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/subscribers".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentCheckSubscription + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/subscription" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WatchInfo.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentDeleteSubscription + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/subscription" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentPutSubscription + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/subscription" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WatchInfo.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListTags + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/tags" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/tags".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Tag.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateTag + ( + owner : string, + repo : string, + body : CreateTagOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/tags" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateTagOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Tag.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetTag + (owner : string, repo : string, tag : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/tags/{tag}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{tag}", tag.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Tag.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteTag + (owner : string, repo : string, tag : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/tags/{tag}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{tag}", tag.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListTeams (owner : string, repo : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/teams" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Team.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCheckTeam + (owner : string, repo : string, team : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/teams/{team}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{team}", team.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Team.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteTeam + (owner : string, repo : string, team : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/teams/{team}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{team}", team.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoAddTeam + (owner : string, repo : string, team : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/teams/{team}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{team}", team.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoTrackedTimes + ( + owner : string, + repo : string, + user : string, + since : string, + before : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/times" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/times".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "user=" + + ((user.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> TrackedTime.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserTrackedTimes + (owner : string, repo : string, user : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/times/{user}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{user}", user.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> TrackedTime.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoListTopics + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/topics" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/topics".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return TopicName.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoUpdateTopics + ( + owner : string, + repo : string, + body : RepoTopicOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/topics" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> RepoTopicOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteTopic + (owner : string, repo : string, topic : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/topics/{topic}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{topic}", topic.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoAddTopic + (owner : string, repo : string, topic : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/topics/{topic}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{topic}", topic.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoTransfer + ( + owner : string, + repo : string, + body : TransferRepoOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/transfer" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> TransferRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.AcceptRepoTransfer + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/transfer/accept" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RejectRepoTransfer + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/transfer/reject" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoCreateWikiPage + ( + owner : string, + repo : string, + body : CreateWikiPageOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/wiki/new" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateWikiPageOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WikiPage.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetWikiPage + (owner : string, repo : string, pageName : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/wiki/page/{pageName}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{pageName}", pageName.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WikiPage.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoDeleteWikiPage + (owner : string, repo : string, pageName : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/wiki/page/{pageName}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{pageName}", pageName.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoEditWikiPage + ( + owner : string, + repo : string, + pageName : string, + body : CreateWikiPageOptions, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{owner}/{repo}/wiki/page/{pageName}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{pageName}", pageName.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateWikiPageOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WikiPage.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetWikiPages + ( + owner : string, + repo : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/wiki/pages" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/wiki/pages".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> WikiPageMetaData.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetWikiPageRevisions + ( + owner : string, + repo : string, + pageName : string, + page : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("repos/{owner}/{repo}/wiki/revisions/{pageName}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace("{repo}", repo.ToString () |> System.Uri.EscapeDataString) + .Replace ("{pageName}", pageName.ToString () |> System.Uri.EscapeDataString) + + (if "repos/{owner}/{repo}/wiki/revisions/{pageName}".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return WikiCommitList.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GenerateRepo + ( + template_owner : string, + template_repo : string, + body : GenerateRepoOption, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repos/{template_owner}/{template_repo}/generate" + .Replace( + "{template_owner}", + template_owner.ToString () |> System.Uri.EscapeDataString + ) + .Replace ( + "{template_repo}", + template_repo.ToString () |> System.Uri.EscapeDataString + ), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> GenerateRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.RepoGetByID (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "repositories/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetGeneralAPISettings (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("settings/api", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GeneralAPISettings.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetGeneralAttachmentSettings (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("settings/attachment", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GeneralAttachmentSettings.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetGeneralRepositorySettings (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("settings/repository", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GeneralRepoSettings.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetGeneralUISettings (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("settings/ui", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return GeneralUISettings.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetSigningKey (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("signing-key.gpg", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgGetTeam (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}".Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Team.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgDeleteTeam (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}".Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgEditTeam (id : int, body : EditTeamOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}".Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> EditTeamOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Team.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListTeamMembers + (id : int, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("teams/{id}/members" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString) + + (if "teams/{id}/members".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListTeamMember + (id : int, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}/members/{username}" + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return User.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgRemoveTeamMember + (id : int, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}/members/{username}" + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgAddTeamMember + (id : int, username : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}/members/{username}" + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListTeamRepos + (id : int, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("teams/{id}/repos" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString) + + (if "teams/{id}/repos".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListTeamRepo + (id : int, org : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}/repos/{org}/{repo}" + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgRemoveTeamRepository + (id : int, org : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}/repos/{org}/{repo}" + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgAddTeamRepository + (id : int, org : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "teams/{id}/repos/{org}/{repo}" + .Replace("{id}", id.ToString () |> System.Uri.EscapeDataString) + .Replace("{org}", org.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.TopicSearch + (q : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("topics/search" + + (if "topics/search".IndexOf (char 63) >= 0 then "&" else "?") + + "q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> TopicResponse.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGetCurrent (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return User.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGetOauth2Application + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/applications/oauth2" + + (if "user/applications/oauth2".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> OAuth2Application.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCreateOAuth2Application + (body : CreateOAuth2ApplicationOptions, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/applications/oauth2", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateOAuth2ApplicationOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return OAuth2Application.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGetOAuth2Application (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/applications/oauth2/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return OAuth2Application.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserDeleteOAuth2Application (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/applications/oauth2/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserUpdateOAuth2Application + (id : int, body : CreateOAuth2ApplicationOptions, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/applications/oauth2/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateOAuth2ApplicationOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return OAuth2Application.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListEmails (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/emails", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Email.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserAddEmail (body : CreateEmailOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/emails", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateEmailOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Email.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserDeleteEmail (body : DeleteEmailOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/emails", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> DeleteEmailOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentListFollowers + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/followers" + + (if "user/followers".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentListFollowing + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/following" + + (if "user/following".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentCheckFollowing (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/following/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentDeleteFollow (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/following/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentPutFollow (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/following/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetVerificationToken (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/gpg_key_token", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseString = response.Content.ReadAsStringAsync ct |> Async.AwaitTask + return responseString + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentDeleteGPGKey (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/gpg_keys/{id}" + .Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentListKeys + (fingerprint : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/keys" + + (if "user/keys".IndexOf (char 63) >= 0 then "&" else "?") + + "fingerprint=" + + ((fingerprint.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PublicKey.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentPostKey (body : CreateKeyOption, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/keys", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateKeyOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PublicKey.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentGetKey (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/keys/{id}".Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return PublicKey.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentDeleteKey (id : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/keys/{id}".Replace ("{id}", id.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListCurrentUserOrgs + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/orgs" + + (if "user/orgs".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Organization.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentListRepos + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/repos" + + (if "user/repos".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.CreateCurrentUserRepo + (body : CreateRepoOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/repos", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateRepoOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return Repository.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetUserSettings (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/settings", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> UserSettings.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UpdateUserSettings + (body : UserSettingsOptions, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("user/settings", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> UserSettingsOptions.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> UserSettings.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentListStarred + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/starred" + + (if "user/starred".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentCheckStarring + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/starred/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentDeleteStar + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/starred/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentPutStar + (owner : string, repo : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "user/starred/{owner}/{repo}" + .Replace("{owner}", owner.ToString () |> System.Uri.EscapeDataString) + .Replace ("{repo}", repo.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Put, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGetStopWatches (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/stopwatches" + + (if "user/stopwatches".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> StopWatch.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentListSubscriptions + (page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/subscriptions" + + (if "user/subscriptions".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListTeams (page : int, limit : int, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/teams" + + (if "user/teams".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> Team.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCurrentTrackedTimes + ( + page : int, + limit : int, + since : string, + before : string, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("user/times" + + (if "user/times".IndexOf (char 63) >= 0 then "&" else "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString) + + "&since=" + + ((since.ToString ()) |> System.Uri.EscapeDataString) + + "&before=" + + ((before.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> TrackedTime.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserSearch + (q : string, uid : int, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/search" + + (if "users/search".IndexOf (char 63) >= 0 then "&" else "?") + + "q=" + + ((q.ToString ()) |> System.Uri.EscapeDataString) + + "&uid=" + + ((uid.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGet (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "users/{username}" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return User.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListFollowers + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/followers" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/followers".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListFollowing + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/following" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/following".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return jsonNode.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCheckFollowing + (username : string, target : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "users/{username}/following/{target}" + .Replace("{username}", username.ToString () |> System.Uri.EscapeDataString) + .Replace ("{target}", target.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGetHeatmapData (username : string, ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "users/{username}/heatmap" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> UserHeatmapData.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListKeys + ( + username : string, + fingerprint : string, + page : int, + limit : int, + ct : System.Threading.CancellationToken option + ) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/keys" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/keys".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "fingerprint=" + + ((fingerprint.ToString ()) |> System.Uri.EscapeDataString) + + "&page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> PublicKey.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgListUserOrgs + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/orgs" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/orgs".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Organization.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.OrgGetUserPermissions + (username : string, org : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "users/{username}/orgs/{org}/permissions" + .Replace("{username}", username.ToString () |> System.Uri.EscapeDataString) + .Replace ("{org}", org.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return OrganizationPermissions.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListRepos + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/repos" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/repos".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListStarred + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/starred" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/starred".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserListSubscriptions + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/subscriptions" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/subscriptions".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserGetTokens + (username : string, page : int, limit : int, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + ("users/{username}/tokens" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString) + + (if "users/{username}/tokens".IndexOf (char 63) >= 0 then + "&" + else + "?") + + "page=" + + ((page.ToString ()) |> System.Uri.EscapeDataString) + + "&limit=" + + ((limit.ToString ()) |> System.Uri.EscapeDataString)), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return + jsonNode.AsArray () + |> Seq.map (fun elt -> AccessToken.jsonParse elt) + |> List.ofSeq + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserCreateToken + (username : string, body : CreateAccessTokenOption, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "users/{username}/tokens" + .Replace ("{username}", username.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Post, + RequestUri = uri + ) + + let queryParams = + new System.Net.Http.StringContent ( + body + |> CreateAccessTokenOption.toJsonNode + |> (fun node -> if isNull node then "null" else node.ToJsonString ()), + null, + "application/json" + ) + + do httpMessage.Content <- queryParams + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return AccessToken.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.UserDeleteAccessToken + (username : string, token : string, ct : System.Threading.CancellationToken option) + = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ( + "users/{username}/tokens/{token}" + .Replace("{username}", username.ToString () |> System.Uri.EscapeDataString) + .Replace ("{token}", token.ToString () |> System.Uri.EscapeDataString), + System.UriKind.Relative + ) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Delete, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + return () + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + + member _.GetVersion (ct : System.Threading.CancellationToken option) = + async { + let! ct = Async.CancellationToken + + let uri = + System.Uri ( + System.Uri ( + (match client.BaseAddress with + | null -> + raise ( + System.ArgumentNullException ( + nameof (client.BaseAddress), + "No base address was supplied on the type, and no BaseAddress was on the HttpClient." + ) + ) + | v -> v), + System.Uri ("/api/v1/", System.UriKind.Relative) + ), + System.Uri ("version", System.UriKind.Relative) + ) + + let httpMessage = + new System.Net.Http.HttpRequestMessage ( + Method = System.Net.Http.HttpMethod.Get, + RequestUri = uri + ) + + let! response = client.SendAsync (httpMessage, ct) |> Async.AwaitTask + let response = response.EnsureSuccessStatusCode () + let! responseStream = response.Content.ReadAsStreamAsync ct |> Async.AwaitTask + + let! jsonNode = + System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct) + |> Async.AwaitTask + + return ServerVersion.jsonParse jsonNode + } + |> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct)) + } diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGiteaMockAndJson.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGiteaMockAndJson.fs new file mode 100644 index 0000000..02a63e0 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/GeneratedSwaggerGiteaMockAndJson.fs @@ -0,0 +1,29583 @@ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Mock record type for an interface +type internal GiteaMock = + { + /// Returns the Person actor for a user + ActivitypubPerson : + string * option -> ActivityPub System.Threading.Tasks.Task + /// Send to the inbox + ActivitypubPersonInbox : string * option -> unit System.Threading.Tasks.Task + /// List cron tasks + AdminCronList : int * int * option -> Cron list System.Threading.Tasks.Task + /// Run cron task + AdminCronRun : string * option -> unit System.Threading.Tasks.Task + /// List system's webhooks + AdminListHooks : int * int * option -> Hook list System.Threading.Tasks.Task + /// Create a hook + AdminCreateHook : + CreateHookOption * option -> Hook System.Threading.Tasks.Task + /// Get a hook + AdminGetHook : int * option -> Hook System.Threading.Tasks.Task + /// Update a hook + AdminEditHook : + int * EditHookOption * option -> Hook System.Threading.Tasks.Task + /// List all organizations + AdminGetAllOrgs : + int * int * option -> Organization list System.Threading.Tasks.Task + /// List unadopted repositories + AdminUnadoptedList : + int * int * string * option -> string list System.Threading.Tasks.Task + /// Adopt unadopted files as a repository + AdminAdoptRepository : + string * string * option -> unit System.Threading.Tasks.Task + /// Delete unadopted files + AdminDeleteUnadoptedRepository : + string * string * option -> unit System.Threading.Tasks.Task + /// List all users + AdminGetAllUsers : + int * int * option -> User list System.Threading.Tasks.Task + /// Create a user + AdminCreateUser : + CreateUserOption * option -> User System.Threading.Tasks.Task + /// Delete a user + AdminDeleteUser : string * bool * option -> unit System.Threading.Tasks.Task + /// Edit an existing user + AdminEditUser : + string * EditUserOption * option -> User System.Threading.Tasks.Task + /// Add a public key on behalf of a user + AdminCreatePublicKey : + string * CreateKeyOption * option + -> PublicKey System.Threading.Tasks.Task + /// Delete a user's public key + AdminDeleteUserPublicKey : + string * int * option -> unit System.Threading.Tasks.Task + /// Create an organization + AdminCreateOrg : + string * CreateOrgOption * option + -> Organization System.Threading.Tasks.Task + /// Create a repository on behalf of a user + AdminCreateRepo : + string * CreateRepoOption * option + -> Repository System.Threading.Tasks.Task + /// Delete a hook + AdminDeleteHook : int * option -> unit System.Threading.Tasks.Task + /// Render a markdown document as HTML + RenderMarkdown : + MarkdownOption * option -> string System.Threading.Tasks.Task + /// Render raw markdown as HTML + RenderMarkdownRaw : string * option -> string System.Threading.Tasks.Task + /// Returns the nodeinfo of the Gitea application + GetNodeInfo : option -> NodeInfo System.Threading.Tasks.Task + /// List users's notification threads + NotifyGetList : + bool * string list * string list * string * string * int * int * option + -> NotificationThread list System.Threading.Tasks.Task + /// Mark notification threads as read, pinned or unread + NotifyReadList : + string * string * string list * string * option + -> NotificationThread list System.Threading.Tasks.Task + /// Check if unread notifications exist + NotifyNewAvailable : option -> NotificationCount System.Threading.Tasks.Task + /// Get notification thread by ID + NotifyGetThread : + string * option -> NotificationThread System.Threading.Tasks.Task + /// Mark notification thread as read by ID + NotifyReadThread : + string * string * option + -> NotificationThread System.Threading.Tasks.Task + /// Create a repository in an organization + CreateOrgRepoDeprecated : + string * CreateRepoOption * option + -> Repository System.Threading.Tasks.Task + /// Get list of organizations + OrgGetAll : + int * int * option -> Organization list System.Threading.Tasks.Task + /// Create an organization + OrgCreate : + CreateOrgOption * option -> Organization System.Threading.Tasks.Task + /// Get an organization + OrgGet : string * option -> Organization System.Threading.Tasks.Task + /// Delete an organization + OrgDelete : string * option -> unit System.Threading.Tasks.Task + /// Edit an organization + OrgEdit : + string * EditOrgOption * option + -> Organization System.Threading.Tasks.Task + /// List an organization's webhooks + OrgListHooks : + string * int * int * option -> Hook list System.Threading.Tasks.Task + /// Create a hook + OrgCreateHook : + string * CreateHookOption * option -> Hook System.Threading.Tasks.Task + /// Get a hook + OrgGetHook : string * int * option -> Hook System.Threading.Tasks.Task + /// Delete a hook + OrgDeleteHook : string * int * option -> unit System.Threading.Tasks.Task + /// Update a hook + OrgEditHook : + string * int * EditHookOption * option + -> Hook System.Threading.Tasks.Task + /// List an organization's labels + OrgListLabels : + string * int * int * option -> Label list System.Threading.Tasks.Task + /// Create a label for an organization + OrgCreateLabel : + string * CreateLabelOption * option -> Label System.Threading.Tasks.Task + /// Get a single label + OrgGetLabel : string * int * option -> Label System.Threading.Tasks.Task + /// Delete a label + OrgDeleteLabel : string * int * option -> unit System.Threading.Tasks.Task + /// Update a label + OrgEditLabel : + string * int * EditLabelOption * option + -> Label System.Threading.Tasks.Task + /// List an organization's members + OrgListMembers : + string * int * int * option -> User list System.Threading.Tasks.Task + /// Check if a user is a member of an organization + OrgIsMember : string * string * option -> unit System.Threading.Tasks.Task + /// Remove a member from an organization + OrgDeleteMember : + string * string * option -> unit System.Threading.Tasks.Task + /// List an organization's public members + OrgListPublicMembers : + string * int * int * option -> User list System.Threading.Tasks.Task + /// Check if a user is a public member of an organization + OrgIsPublicMember : + string * string * option -> unit System.Threading.Tasks.Task + /// Conceal a user's membership + OrgConcealMember : + string * string * option -> unit System.Threading.Tasks.Task + /// Publicize a user's membership + OrgPublicizeMember : + string * string * option -> unit System.Threading.Tasks.Task + /// List an organization's repos + OrgListRepos : + string * int * int * option + -> Repository list System.Threading.Tasks.Task + /// Create a repository in an organization + CreateOrgRepo : + string * CreateRepoOption * option + -> Repository System.Threading.Tasks.Task + /// List an organization's teams + OrgListTeams : + string * int * int * option -> Team list System.Threading.Tasks.Task + /// Create a team + OrgCreateTeam : + string * CreateTeamOption * option -> Team System.Threading.Tasks.Task + /// Search for teams within an organization + TeamSearch : + string * string * bool * int * int * option + -> unit System.Threading.Tasks.Task + /// Gets all packages of an owner + ListPackages : + string * int * int * string * string * option + -> Package list System.Threading.Tasks.Task + /// Gets a package + GetPackage : + string * string * string * string * option + -> Package System.Threading.Tasks.Task + /// Delete a package + DeletePackage : + string * string * string * string * option + -> unit System.Threading.Tasks.Task + /// Gets all files of a package + ListPackageFiles : + string * string * string * string * option + -> PackageFile list System.Threading.Tasks.Task + /// Search for issues across the repositories that the user has access to + IssueSearchIssues : + string * + string * + string * + string * + int * + string * + string * + string * + bool * + bool * + bool * + bool * + string * + string * + int * + int * + option + -> Issue list System.Threading.Tasks.Task + /// Migrate a remote git repository + RepoMigrate : + MigrateRepoOptions * option -> Repository System.Threading.Tasks.Task + /// Search for repositories + RepoSearch : + string * + bool * + bool * + int * + int * + int * + int * + bool * + bool * + bool * + bool * + string * + bool * + string * + string * + int * + int * + option + -> SearchResults System.Threading.Tasks.Task + /// Get a repository + RepoGet : string * string * option -> Repository System.Threading.Tasks.Task + /// Delete a repository + RepoDelete : string * string * option -> unit System.Threading.Tasks.Task + /// Edit a repository's properties. Only fields that are set will be changed. + RepoEdit : + string * string * EditRepoOption * option + -> Repository System.Threading.Tasks.Task + /// Get an archive of a repository + RepoGetArchive : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Return all users that have write access and can be assigned to issues + RepoGetAssignees : + string * string * option -> User list System.Threading.Tasks.Task + /// List branch protections for a repository + RepoListBranchProtection : + string * string * option + -> BranchProtection list System.Threading.Tasks.Task + /// Create a branch protections for a repository + RepoCreateBranchProtection : + string * string * CreateBranchProtectionOption * option + -> BranchProtection System.Threading.Tasks.Task + /// Get a specific branch protection for the repository + RepoGetBranchProtection : + string * string * string * option + -> BranchProtection System.Threading.Tasks.Task + /// Delete a specific branch protection for the repository + RepoDeleteBranchProtection : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Edit a branch protections for a repository. Only fields that are set will be changed + RepoEditBranchProtection : + string * string * string * EditBranchProtectionOption * option + -> BranchProtection System.Threading.Tasks.Task + /// List a repository's branches + RepoListBranches : + string * string * int * int * option + -> Branch list System.Threading.Tasks.Task + /// Create a branch + RepoCreateBranch : + string * string * CreateBranchRepoOption * option + -> Branch System.Threading.Tasks.Task + /// Retrieve a specific branch from a repository, including its effective branch protection + RepoGetBranch : + string * string * string * option -> Branch System.Threading.Tasks.Task + /// Delete a specific branch from a repository + RepoDeleteBranch : + string * string * string * option -> unit System.Threading.Tasks.Task + /// List a repository's collaborators + RepoListCollaborators : + string * string * int * int * option + -> User list System.Threading.Tasks.Task + /// Check if a user is a collaborator of a repository + RepoCheckCollaborator : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Delete a collaborator from a repository + RepoDeleteCollaborator : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Add a collaborator to a repository + RepoAddCollaborator : + string * string * string * AddCollaboratorOption * option + -> unit System.Threading.Tasks.Task + /// Get repository permissions for a user + RepoGetRepoPermissions : + string * string * string * option + -> RepoCollaboratorPermission System.Threading.Tasks.Task + /// Get a list of all commits from a repository + RepoGetAllCommits : + string * string * string * string * bool * int * int * option + -> Commit list System.Threading.Tasks.Task + /// Get a commit's combined status, by branch/tag/commit reference + RepoGetCombinedStatusByRef : + string * string * string * int * int * option + -> CombinedStatus System.Threading.Tasks.Task + /// Get a commit's statuses, by branch/tag/commit reference + RepoListStatusesByRef : + string * string * string * string * string * int * int * option + -> CommitStatus list System.Threading.Tasks.Task + /// Gets the metadata of all the entries of the root dir + RepoGetContentsList : + string * string * string * option + -> ContentsResponse list System.Threading.Tasks.Task + /// Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir + RepoGetContents : + string * string * string * string * option + -> ContentsResponse System.Threading.Tasks.Task + /// Create a file in a repository + RepoCreateFile : + string * string * string * CreateFileOptions * option + -> FileResponse System.Threading.Tasks.Task + /// Delete a file in a repository + RepoDeleteFile : + string * string * string * DeleteFileOptions * option + -> FileDeleteResponse System.Threading.Tasks.Task + /// Update a file in a repository + RepoUpdateFile : + string * string * string * UpdateFileOptions * option + -> FileResponse System.Threading.Tasks.Task + /// Apply diff patch to repository + RepoApplyDiffPatch : + string * string * UpdateFileOptions * option + -> FileResponse System.Threading.Tasks.Task + /// Get the EditorConfig definitions of a file in a repository + RepoGetEditorConfig : + string * string * string * string * option + -> unit System.Threading.Tasks.Task + /// List a repository's forks + ListForks : + string * string * int * int * option + -> Repository list System.Threading.Tasks.Task + /// Fork a repository + CreateFork : + string * string * CreateForkOption * option + -> Repository System.Threading.Tasks.Task + /// Gets the blob of a repository. + GetBlob : + string * string * string * option + -> GitBlobResponse System.Threading.Tasks.Task + /// Get a single commit from a repository + RepoGetSingleCommit : + string * string * string * option -> Commit System.Threading.Tasks.Task + /// Get a commit's diff or patch + RepoDownloadCommitDiffOrPatch : + string * string * string * string * option + -> string System.Threading.Tasks.Task + /// Get a note corresponding to a single commit from a repository + RepoGetNote : + string * string * string * option -> Note System.Threading.Tasks.Task + /// Get specified ref or filtered repository's refs + RepoListAllGitRefs : + string * string * option -> Reference list System.Threading.Tasks.Task + /// Get specified ref or filtered repository's refs + RepoListGitRefs : + string * string * string * option + -> Reference list System.Threading.Tasks.Task + /// Gets the tag object of an annotated tag (not lightweight tags) + GetAnnotatedTag : + string * string * string * option + -> AnnotatedTag System.Threading.Tasks.Task + /// Gets the tree of a repository. + GetTree : + string * string * string * bool * int * int * option + -> GitTreeResponse System.Threading.Tasks.Task + /// List the hooks in a repository + RepoListHooks : + string * string * int * int * option + -> Hook list System.Threading.Tasks.Task + /// Create a hook + RepoCreateHook : + string * string * CreateHookOption * option + -> Hook System.Threading.Tasks.Task + /// List the Git hooks in a repository + RepoListGitHooks : + string * string * option -> GitHook list System.Threading.Tasks.Task + /// Get a Git hook + RepoGetGitHook : + string * string * string * option -> GitHook System.Threading.Tasks.Task + /// Delete a Git hook in a repository + RepoDeleteGitHook : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Edit a Git hook in a repository + RepoEditGitHook : + string * string * string * EditGitHookOption * option + -> GitHook System.Threading.Tasks.Task + /// Get a hook + RepoGetHook : + string * string * int * option -> Hook System.Threading.Tasks.Task + /// Delete a hook in a repository + RepoDeleteHook : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Edit a hook in a repository + RepoEditHook : + string * string * int * EditHookOption * option + -> Hook System.Threading.Tasks.Task + /// Test a push webhook + RepoTestHook : + string * string * int * string * option + -> unit System.Threading.Tasks.Task + /// Get available issue templates for a repository + RepoGetIssueTemplates : + string * string * option + -> IssueTemplate list System.Threading.Tasks.Task + /// List a repository's issues + IssueListIssues : + string * + string * + string * + string * + string * + string * + string * + string * + string * + string * + string * + string * + int * + int * + option + -> Issue list System.Threading.Tasks.Task + /// Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + IssueCreateIssue : + string * string * CreateIssueOption * option + -> Issue System.Threading.Tasks.Task + /// List all comments in a repository + IssueGetRepoComments : + string * string * string * string * int * int * option + -> Comment list System.Threading.Tasks.Task + /// Delete a comment + IssueDeleteComment : + string * string * int * option -> unit System.Threading.Tasks.Task + /// List comment's attachments + IssueListIssueCommentAttachments : + string * string * int * option + -> Attachment list System.Threading.Tasks.Task + /// Get a comment attachment + IssueGetIssueCommentAttachment : + string * string * int * int * option + -> Attachment System.Threading.Tasks.Task + /// Delete a comment attachment + IssueDeleteIssueCommentAttachment : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// Edit a comment attachment + IssueEditIssueCommentAttachment : + string * string * int * int * EditAttachmentOptions * option + -> Attachment System.Threading.Tasks.Task + /// Get a list of reactions from a comment of an issue + IssueGetCommentReactions : + string * string * int * option + -> Reaction list System.Threading.Tasks.Task + /// Remove a reaction from a comment of an issue + IssueDeleteCommentReaction : + string * string * int * EditReactionOption * option + -> unit System.Threading.Tasks.Task + /// Get an issue + IssueGetIssue : + string * string * int * option -> Issue System.Threading.Tasks.Task + /// Delete an issue + IssueDelete : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. + IssueEditIssue : + string * string * int * EditIssueOption * option + -> Issue System.Threading.Tasks.Task + /// List issue's attachments + IssueListIssueAttachments : + string * string * int * option + -> Attachment list System.Threading.Tasks.Task + /// Get an issue attachment + IssueGetIssueAttachment : + string * string * int * int * option + -> Attachment System.Threading.Tasks.Task + /// Delete an issue attachment + IssueDeleteIssueAttachment : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// Edit an issue attachment + IssueEditIssueAttachment : + string * string * int * int * EditAttachmentOptions * option + -> Attachment System.Threading.Tasks.Task + /// List all comments on an issue + IssueGetComments : + string * string * int * string * string * option + -> Comment list System.Threading.Tasks.Task + /// Add a comment to an issue + IssueCreateComment : + string * string * int * CreateIssueCommentOption * option + -> Comment System.Threading.Tasks.Task + /// Delete a comment + IssueDeleteCommentDeprecated : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. + IssueEditIssueDeadline : + string * string * int * EditDeadlineOption * option + -> IssueDeadline System.Threading.Tasks.Task + /// Get an issue's labels + IssueGetLabels : + string * string * int * option -> Label list System.Threading.Tasks.Task + /// Add a label to an issue + IssueAddLabel : + string * string * int * IssueLabelsOption * option + -> Label list System.Threading.Tasks.Task + /// Remove all labels from an issue + IssueClearLabels : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Replace an issue's labels + IssueReplaceLabels : + string * string * int * IssueLabelsOption * option + -> Label list System.Threading.Tasks.Task + /// Remove a label from an issue + IssueRemoveLabel : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// Get a list reactions of an issue + IssueGetIssueReactions : + string * string * int * int * int * option + -> Reaction list System.Threading.Tasks.Task + /// Remove a reaction from an issue + IssueDeleteIssueReaction : + string * string * int * EditReactionOption * option + -> unit System.Threading.Tasks.Task + /// Delete an issue's existing stopwatch. + IssueDeleteStopWatch : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Start stopwatch on an issue. + IssueStartStopWatch : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Stop an issue's existing stopwatch. + IssueStopStopWatch : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Get users who subscribed on an issue. + IssueSubscriptions : + string * string * int * int * int * option + -> User list System.Threading.Tasks.Task + /// Check if user is subscribed to an issue + IssueCheckSubscription : + string * string * int * option -> WatchInfo System.Threading.Tasks.Task + /// List all comments and events on an issue + IssueGetCommentsAndTimeline : + string * string * int * string * int * int * string * option + -> TimelineComment list System.Threading.Tasks.Task + /// List an issue's tracked times + IssueTrackedTimes : + string * string * int * string * string * string * int * int * option + -> TrackedTime list System.Threading.Tasks.Task + /// Add tracked time to a issue + IssueAddTime : + string * string * int * AddTimeOption * option + -> TrackedTime System.Threading.Tasks.Task + /// Reset a tracked time of an issue + IssueResetTime : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Delete specific tracked time + IssueDeleteTime : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// List a repository's keys + RepoListKeys : + string * string * int * string * int * int * option + -> DeployKey list System.Threading.Tasks.Task + /// Add a key to a repository + RepoCreateKey : + string * string * CreateKeyOption * option + -> DeployKey System.Threading.Tasks.Task + /// Get a repository's key by id + RepoGetKey : + string * string * int * option -> DeployKey System.Threading.Tasks.Task + /// Delete a key from a repository + RepoDeleteKey : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Get all of a repository's labels + IssueListLabels : + string * string * int * int * option + -> Label list System.Threading.Tasks.Task + /// Create a label + IssueCreateLabel : + string * string * CreateLabelOption * option + -> Label System.Threading.Tasks.Task + /// Get a single label + IssueGetLabel : + string * string * int * option -> Label System.Threading.Tasks.Task + /// Delete a label + IssueDeleteLabel : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Update a label + IssueEditLabel : + string * string * int * EditLabelOption * option + -> Label System.Threading.Tasks.Task + /// Get languages and number of bytes of code written + RepoGetLanguages : + string * string * option + -> LanguageStatistics System.Threading.Tasks.Task + /// Get a file or it's LFS object from a repository + RepoGetRawFileOrLFS : + string * string * string * string * option + -> unit System.Threading.Tasks.Task + /// Get all of a repository's opened milestones + IssueGetMilestonesList : + string * string * string * string * int * int * option + -> Milestone list System.Threading.Tasks.Task + /// Create a milestone + IssueCreateMilestone : + string * string * CreateMilestoneOption * option + -> Milestone System.Threading.Tasks.Task + /// Get a milestone + IssueGetMilestone : + string * string * string * option + -> Milestone System.Threading.Tasks.Task + /// Delete a milestone + IssueDeleteMilestone : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Update a milestone + IssueEditMilestone : + string * string * string * EditMilestoneOption * option + -> Milestone System.Threading.Tasks.Task + /// Sync a mirrored repository + RepoMirrorSync : + string * string * option -> unit System.Threading.Tasks.Task + /// List users's notification threads on a specific repo + NotifyGetRepoList : + string * + string * + bool * + string list * + string list * + string * + string * + int * + int * + option + -> NotificationThread list System.Threading.Tasks.Task + /// Mark notification threads as read, pinned or unread on a specific repo + NotifyReadRepoList : + string * string * string * string list * string * string * option + -> NotificationThread list System.Threading.Tasks.Task + /// List a repo's pull requests + RepoListPullRequests : + string * string * string * string * int * int list * int * int * option + -> PullRequest list System.Threading.Tasks.Task + /// Create a pull request + RepoCreatePullRequest : + string * string * CreatePullRequestOption * option + -> PullRequest System.Threading.Tasks.Task + /// Get a pull request + RepoGetPullRequest : + string * string * int * option + -> PullRequest System.Threading.Tasks.Task + /// Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. + RepoEditPullRequest : + string * string * int * EditPullRequestOption * option + -> PullRequest System.Threading.Tasks.Task + /// Get a pull request diff or patch + RepoDownloadPullDiffOrPatch : + string * string * int * string * bool * option + -> string System.Threading.Tasks.Task + /// Get commits for a pull request + RepoGetPullRequestCommits : + string * string * int * int * int * option + -> Commit list System.Threading.Tasks.Task + /// Get changed files for a pull request + RepoGetPullRequestFiles : + string * string * int * string * string * int * int * option + -> ChangedFile list System.Threading.Tasks.Task + /// Check if a pull request has been merged + RepoPullRequestIsMerged : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Merge a pull request + RepoMergePullRequest : + string * string * int * MergePullRequestOption * option + -> unit System.Threading.Tasks.Task + /// Cancel the scheduled auto merge for the given pull request + RepoCancelScheduledAutoMerge : + string * string * int * option -> unit System.Threading.Tasks.Task + /// create review requests for a pull request + RepoCreatePullReviewRequests : + string * string * int * PullReviewRequestOptions * option + -> PullReview list System.Threading.Tasks.Task + /// cancel review requests for a pull request + RepoDeletePullReviewRequests : + string * string * int * PullReviewRequestOptions * option + -> unit System.Threading.Tasks.Task + /// List all reviews for a pull request + RepoListPullReviews : + string * string * int * int * int * option + -> PullReview list System.Threading.Tasks.Task + /// Create a review to an pull request + RepoCreatePullReview : + string * string * int * CreatePullReviewOptions * option + -> PullReview System.Threading.Tasks.Task + /// Get a specific review for a pull request + RepoGetPullReview : + string * string * int * int * option + -> PullReview System.Threading.Tasks.Task + /// Submit a pending review to an pull request + RepoSubmitPullReview : + string * string * int * int * SubmitPullReviewOptions * option + -> PullReview System.Threading.Tasks.Task + /// Delete a specific review from a pull request + RepoDeletePullReview : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// Get a specific review for a pull request + RepoGetPullReviewComments : + string * string * int * int * option + -> PullReviewComment list System.Threading.Tasks.Task + /// Dismiss a review for a pull request + RepoDismissPullReview : + string * string * int * int * DismissPullReviewOptions * option + -> PullReview System.Threading.Tasks.Task + /// Cancel to dismiss a review for a pull request + RepoUnDismissPullReview : + string * string * int * int * option + -> PullReview System.Threading.Tasks.Task + /// Merge PR's baseBranch into headBranch + RepoUpdatePullRequest : + string * string * int * string * option + -> unit System.Threading.Tasks.Task + /// Get all push mirrors of the repository + RepoListPushMirrors : + string * string * int * int * option + -> PushMirror list System.Threading.Tasks.Task + /// add a push mirror to the repository + RepoAddPushMirror : + string * string * CreatePushMirrorOption * option + -> PushMirror System.Threading.Tasks.Task + /// Sync all push mirrored repository + RepoPushMirrorSync : + string * string * option -> unit System.Threading.Tasks.Task + /// Get push mirror of the repository by remoteName + RepoGetPushMirrorByRemoteName : + string * string * string * option + -> PushMirror System.Threading.Tasks.Task + /// deletes a push mirror from a repository by remoteName + RepoDeletePushMirror : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Get a file from a repository + RepoGetRawFile : + string * string * string * string * option + -> unit System.Threading.Tasks.Task + /// List a repo's releases + RepoListReleases : + string * string * bool * bool * int * int * int * option + -> Release list System.Threading.Tasks.Task + /// Create a release + RepoCreateRelease : + string * string * CreateReleaseOption * option + -> Release System.Threading.Tasks.Task + /// Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at + RepoGetLatestRelease : + string * string * option -> Release System.Threading.Tasks.Task + /// Get a release by tag name + RepoGetReleaseByTag : + string * string * string * option -> Release System.Threading.Tasks.Task + /// Delete a release by tag name + RepoDeleteReleaseByTag : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Get a release + RepoGetRelease : + string * string * int * option -> Release System.Threading.Tasks.Task + /// Delete a release + RepoDeleteRelease : + string * string * int * option -> unit System.Threading.Tasks.Task + /// Update a release + RepoEditRelease : + string * string * int * EditReleaseOption * option + -> Release System.Threading.Tasks.Task + /// List release's attachments + RepoListReleaseAttachments : + string * string * int * option + -> Attachment list System.Threading.Tasks.Task + /// Get a release attachment + RepoGetReleaseAttachment : + string * string * int * int * option + -> Attachment System.Threading.Tasks.Task + /// Delete a release attachment + RepoDeleteReleaseAttachment : + string * string * int * int * option -> unit System.Threading.Tasks.Task + /// Edit a release attachment + RepoEditReleaseAttachment : + string * string * int * int * EditAttachmentOptions * option + -> Attachment System.Threading.Tasks.Task + /// Return all users that can be requested to review in this repo + RepoGetReviewers : + string * string * option -> User list System.Threading.Tasks.Task + /// Get signing-key.gpg for given repository + RepoSigningKey : + string * string * option -> unit System.Threading.Tasks.Task + /// List a repo's stargazers + RepoListStargazers : + string * string * int * int * option + -> User list System.Threading.Tasks.Task + /// Get a commit's statuses + RepoListStatuses : + string * string * string * string * string * int * int * option + -> CommitStatus list System.Threading.Tasks.Task + /// Create a commit status + RepoCreateStatus : + string * string * string * CreateStatusOption * option + -> CommitStatus System.Threading.Tasks.Task + /// List a repo's watchers + RepoListSubscribers : + string * string * int * int * option + -> User list System.Threading.Tasks.Task + /// Check if the current user is watching a repo + UserCurrentCheckSubscription : + string * string * option -> WatchInfo System.Threading.Tasks.Task + /// Unwatch a repo + UserCurrentDeleteSubscription : + string * string * option -> unit System.Threading.Tasks.Task + /// Watch a repo + UserCurrentPutSubscription : + string * string * option -> WatchInfo System.Threading.Tasks.Task + /// List a repository's tags + RepoListTags : + string * string * int * int * option + -> Tag list System.Threading.Tasks.Task + /// Create a new git tag in a repository + RepoCreateTag : + string * string * CreateTagOption * option + -> Tag System.Threading.Tasks.Task + /// Get the tag of a repository by tag name + RepoGetTag : + string * string * string * option -> Tag System.Threading.Tasks.Task + /// Delete a repository's tag by name + RepoDeleteTag : + string * string * string * option -> unit System.Threading.Tasks.Task + /// List a repository's teams + RepoListTeams : + string * string * option -> Team list System.Threading.Tasks.Task + /// Check if a team is assigned to a repository + RepoCheckTeam : + string * string * string * option -> Team System.Threading.Tasks.Task + /// Delete a team from a repository + RepoDeleteTeam : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Add a team to a repository + RepoAddTeam : + string * string * string * option -> unit System.Threading.Tasks.Task + /// List a repo's tracked times + RepoTrackedTimes : + string * string * string * string * string * int * int * option + -> TrackedTime list System.Threading.Tasks.Task + /// List a user's tracked times in a repo + UserTrackedTimes : + string * string * string * option + -> TrackedTime list System.Threading.Tasks.Task + /// Get list of topics that a repository has + RepoListTopics : + string * string * int * int * option + -> TopicName System.Threading.Tasks.Task + /// Replace list of topics for a repository + RepoUpdateTopics : + string * string * RepoTopicOptions * option + -> unit System.Threading.Tasks.Task + /// Delete a topic from a repository + RepoDeleteTopic : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Add a topic to a repository + RepoAddTopic : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Transfer a repo ownership + RepoTransfer : + string * string * TransferRepoOption * option + -> Repository System.Threading.Tasks.Task + /// Accept a repo transfer + AcceptRepoTransfer : + string * string * option -> Repository System.Threading.Tasks.Task + /// Reject a repo transfer + RejectRepoTransfer : + string * string * option -> Repository System.Threading.Tasks.Task + /// Create a wiki page + RepoCreateWikiPage : + string * string * CreateWikiPageOptions * option + -> WikiPage System.Threading.Tasks.Task + /// Get a wiki page + RepoGetWikiPage : + string * string * string * option + -> WikiPage System.Threading.Tasks.Task + /// Delete a wiki page + RepoDeleteWikiPage : + string * string * string * option -> unit System.Threading.Tasks.Task + /// Edit a wiki page + RepoEditWikiPage : + string * string * string * CreateWikiPageOptions * option + -> WikiPage System.Threading.Tasks.Task + /// Get all wiki pages + RepoGetWikiPages : + string * string * int * int * option + -> WikiPageMetaData list System.Threading.Tasks.Task + /// Get revisions of a wiki page + RepoGetWikiPageRevisions : + string * string * string * int * option + -> WikiCommitList System.Threading.Tasks.Task + /// Create a repository using a template + GenerateRepo : + string * string * GenerateRepoOption * option + -> Repository System.Threading.Tasks.Task + /// Get a repository by id + RepoGetByID : int * option -> Repository System.Threading.Tasks.Task + /// Get instance's global settings for api + GetGeneralAPISettings : + option -> GeneralAPISettings System.Threading.Tasks.Task + /// Get instance's global settings for Attachment + GetGeneralAttachmentSettings : + option -> GeneralAttachmentSettings System.Threading.Tasks.Task + /// Get instance's global settings for repositories + GetGeneralRepositorySettings : + option -> GeneralRepoSettings System.Threading.Tasks.Task + /// Get instance's global settings for ui + GetGeneralUISettings : + option -> GeneralUISettings System.Threading.Tasks.Task + /// Get default signing-key.gpg + GetSigningKey : option -> unit System.Threading.Tasks.Task + /// Get a team + OrgGetTeam : int * option -> Team System.Threading.Tasks.Task + /// Delete a team + OrgDeleteTeam : int * option -> unit System.Threading.Tasks.Task + /// Edit a team + OrgEditTeam : + int * EditTeamOption * option -> Team System.Threading.Tasks.Task + /// List a team's members + OrgListTeamMembers : + int * int * int * option -> User list System.Threading.Tasks.Task + /// List a particular member of team + OrgListTeamMember : + int * string * option -> User System.Threading.Tasks.Task + /// Remove a team member + OrgRemoveTeamMember : + int * string * option -> unit System.Threading.Tasks.Task + /// Add a team member + OrgAddTeamMember : int * string * option -> unit System.Threading.Tasks.Task + /// List a team's repos + OrgListTeamRepos : + int * int * int * option -> Repository list System.Threading.Tasks.Task + /// List a particular repo of team + OrgListTeamRepo : + int * string * string * option -> Repository System.Threading.Tasks.Task + /// Remove a repository from a team + OrgRemoveTeamRepository : + int * string * string * option -> unit System.Threading.Tasks.Task + /// Add a repository to a team + OrgAddTeamRepository : + int * string * string * option -> unit System.Threading.Tasks.Task + /// search topics via keyword + TopicSearch : + string * int * int * option + -> TopicResponse list System.Threading.Tasks.Task + /// Get the authenticated user + UserGetCurrent : option -> User System.Threading.Tasks.Task + /// List the authenticated user's oauth2 applications + UserGetOauth2Application : + int * int * option -> OAuth2Application list System.Threading.Tasks.Task + /// creates a new OAuth2 application + UserCreateOAuth2Application : + CreateOAuth2ApplicationOptions * option + -> OAuth2Application System.Threading.Tasks.Task + /// get an OAuth2 Application + UserGetOAuth2Application : + int * option -> OAuth2Application System.Threading.Tasks.Task + /// delete an OAuth2 Application + UserDeleteOAuth2Application : + int * option -> unit System.Threading.Tasks.Task + /// update an OAuth2 Application, this includes regenerating the client secret + UserUpdateOAuth2Application : + int * CreateOAuth2ApplicationOptions * option + -> OAuth2Application System.Threading.Tasks.Task + /// List the authenticated user's email addresses + UserListEmails : option -> Email list System.Threading.Tasks.Task + /// Add email addresses + UserAddEmail : + CreateEmailOption * option -> Email list System.Threading.Tasks.Task + /// Delete email addresses + UserDeleteEmail : + DeleteEmailOption * option -> unit System.Threading.Tasks.Task + /// List the authenticated user's followers + UserCurrentListFollowers : + int * int * option -> User list System.Threading.Tasks.Task + /// List the users that the authenticated user is following + UserCurrentListFollowing : + int * int * option -> User list System.Threading.Tasks.Task + /// Check whether a user is followed by the authenticated user + UserCurrentCheckFollowing : + string * option -> unit System.Threading.Tasks.Task + /// Unfollow a user + UserCurrentDeleteFollow : + string * option -> unit System.Threading.Tasks.Task + /// Follow a user + UserCurrentPutFollow : string * option -> unit System.Threading.Tasks.Task + /// Get a Token to verify + GetVerificationToken : option -> string System.Threading.Tasks.Task + /// Remove a GPG key + UserCurrentDeleteGPGKey : int * option -> unit System.Threading.Tasks.Task + /// List the authenticated user's public keys + UserCurrentListKeys : + string * int * int * option + -> PublicKey list System.Threading.Tasks.Task + /// Create a public key + UserCurrentPostKey : + CreateKeyOption * option -> PublicKey System.Threading.Tasks.Task + /// Get a public key + UserCurrentGetKey : int * option -> PublicKey System.Threading.Tasks.Task + /// Delete a public key + UserCurrentDeleteKey : int * option -> unit System.Threading.Tasks.Task + /// List the current user's organizations + OrgListCurrentUserOrgs : + int * int * option -> Organization list System.Threading.Tasks.Task + /// List the repos that the authenticated user owns + UserCurrentListRepos : + int * int * option -> Repository list System.Threading.Tasks.Task + /// Create a repository + CreateCurrentUserRepo : + CreateRepoOption * option -> Repository System.Threading.Tasks.Task + /// Get user settings + GetUserSettings : option -> UserSettings list System.Threading.Tasks.Task + /// Update user settings + UpdateUserSettings : + UserSettingsOptions * option + -> UserSettings list System.Threading.Tasks.Task + /// The repos that the authenticated user has starred + UserCurrentListStarred : + int * int * option -> Repository list System.Threading.Tasks.Task + /// Whether the authenticated is starring the repo + UserCurrentCheckStarring : + string * string * option -> unit System.Threading.Tasks.Task + /// Unstar the given repo + UserCurrentDeleteStar : + string * string * option -> unit System.Threading.Tasks.Task + /// Star the given repo + UserCurrentPutStar : + string * string * option -> unit System.Threading.Tasks.Task + /// Get list of all existing stopwatches + UserGetStopWatches : + int * int * option -> StopWatch list System.Threading.Tasks.Task + /// List repositories watched by the authenticated user + UserCurrentListSubscriptions : + int * int * option -> Repository list System.Threading.Tasks.Task + /// List all the teams a user belongs to + UserListTeams : int * int * option -> Team list System.Threading.Tasks.Task + /// List the current user's tracked times + UserCurrentTrackedTimes : + int * int * string * string * option + -> TrackedTime list System.Threading.Tasks.Task + /// Search for users + UserSearch : + string * int * int * int * option -> unit System.Threading.Tasks.Task + /// Get a user + UserGet : string * option -> User System.Threading.Tasks.Task + /// List the given user's followers + UserListFollowers : + string * int * int * option -> User list System.Threading.Tasks.Task + /// List the users that the given user is following + UserListFollowing : + string * int * int * option -> User list System.Threading.Tasks.Task + /// Check if one user is following another user + UserCheckFollowing : + string * string * option -> unit System.Threading.Tasks.Task + /// Get a user's heatmap + UserGetHeatmapData : + string * option -> UserHeatmapData list System.Threading.Tasks.Task + /// List the given user's public keys + UserListKeys : + string * string * int * int * option + -> PublicKey list System.Threading.Tasks.Task + /// List a user's organizations + OrgListUserOrgs : + string * int * int * option + -> Organization list System.Threading.Tasks.Task + /// Get user permissions in organization + OrgGetUserPermissions : + string * string * option + -> OrganizationPermissions System.Threading.Tasks.Task + /// List the repos owned by the given user + UserListRepos : + string * int * int * option + -> Repository list System.Threading.Tasks.Task + /// The repos that the given user has starred + UserListStarred : + string * int * int * option + -> Repository list System.Threading.Tasks.Task + /// List the repositories watched by a user + UserListSubscriptions : + string * int * int * option + -> Repository list System.Threading.Tasks.Task + /// List the authenticated user's access tokens + UserGetTokens : + string * int * int * option + -> AccessToken list System.Threading.Tasks.Task + /// Create an access token + UserCreateToken : + string * CreateAccessTokenOption * option + -> AccessToken System.Threading.Tasks.Task + /// delete an access token + UserDeleteAccessToken : + string * string * option -> unit System.Threading.Tasks.Task + /// Returns the version of the Gitea application + GetVersion : option -> ServerVersion System.Threading.Tasks.Task + } + + /// An implementation where every method throws. + static member Empty : GiteaMock = + { + ActivitypubPerson = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: ActivitypubPerson")) + ActivitypubPersonInbox = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: ActivitypubPersonInbox")) + AdminCronList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCronList")) + AdminCronRun = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCronRun")) + AdminListHooks = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminListHooks")) + AdminCreateHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCreateHook")) + AdminGetHook = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminGetHook")) + AdminEditHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminEditHook")) + AdminGetAllOrgs = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminGetAllOrgs")) + AdminUnadoptedList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminUnadoptedList")) + AdminAdoptRepository = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminAdoptRepository")) + AdminDeleteUnadoptedRepository = + (fun _ -> + raise ( + System.NotImplementedException "Unimplemented mock function: AdminDeleteUnadoptedRepository" + ) + ) + AdminGetAllUsers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminGetAllUsers")) + AdminCreateUser = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCreateUser")) + AdminDeleteUser = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminDeleteUser")) + AdminEditUser = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminEditUser")) + AdminCreatePublicKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCreatePublicKey")) + AdminDeleteUserPublicKey = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: AdminDeleteUserPublicKey") + ) + AdminCreateOrg = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCreateOrg")) + AdminCreateRepo = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminCreateRepo")) + AdminDeleteHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AdminDeleteHook")) + RenderMarkdown = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RenderMarkdown")) + RenderMarkdownRaw = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RenderMarkdownRaw")) + GetNodeInfo = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetNodeInfo")) + NotifyGetList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyGetList")) + NotifyReadList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyReadList")) + NotifyNewAvailable = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyNewAvailable")) + NotifyGetThread = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyGetThread")) + NotifyReadThread = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyReadThread")) + CreateOrgRepoDeprecated = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: CreateOrgRepoDeprecated")) + OrgGetAll = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgGetAll")) + OrgCreate = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgCreate")) + OrgGet = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgGet")) + OrgDelete = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgDelete")) + OrgEdit = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgEdit")) + OrgListHooks = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListHooks")) + OrgCreateHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgCreateHook")) + OrgGetHook = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgGetHook")) + OrgDeleteHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgDeleteHook")) + OrgEditHook = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgEditHook")) + OrgListLabels = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListLabels")) + OrgCreateLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgCreateLabel")) + OrgGetLabel = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgGetLabel")) + OrgDeleteLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgDeleteLabel")) + OrgEditLabel = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgEditLabel")) + OrgListMembers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListMembers")) + OrgIsMember = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgIsMember")) + OrgDeleteMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgDeleteMember")) + OrgListPublicMembers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListPublicMembers")) + OrgIsPublicMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgIsPublicMember")) + OrgConcealMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgConcealMember")) + OrgPublicizeMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgPublicizeMember")) + OrgListRepos = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListRepos")) + CreateOrgRepo = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: CreateOrgRepo")) + OrgListTeams = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListTeams")) + OrgCreateTeam = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgCreateTeam")) + TeamSearch = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: TeamSearch")) + ListPackages = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: ListPackages")) + GetPackage = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetPackage")) + DeletePackage = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: DeletePackage")) + ListPackageFiles = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: ListPackageFiles")) + IssueSearchIssues = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueSearchIssues")) + RepoMigrate = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoMigrate")) + RepoSearch = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoSearch")) + RepoGet = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGet")) + RepoDelete = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDelete")) + RepoEdit = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoEdit")) + RepoGetArchive = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetArchive")) + RepoGetAssignees = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetAssignees")) + RepoListBranchProtection = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoListBranchProtection") + ) + RepoCreateBranchProtection = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoCreateBranchProtection") + ) + RepoGetBranchProtection = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetBranchProtection")) + RepoDeleteBranchProtection = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteBranchProtection") + ) + RepoEditBranchProtection = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoEditBranchProtection") + ) + RepoListBranches = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListBranches")) + RepoCreateBranch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateBranch")) + RepoGetBranch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetBranch")) + RepoDeleteBranch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteBranch")) + RepoListCollaborators = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListCollaborators")) + RepoCheckCollaborator = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCheckCollaborator")) + RepoDeleteCollaborator = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteCollaborator")) + RepoAddCollaborator = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoAddCollaborator")) + RepoGetRepoPermissions = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetRepoPermissions")) + RepoGetAllCommits = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetAllCommits")) + RepoGetCombinedStatusByRef = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoGetCombinedStatusByRef") + ) + RepoListStatusesByRef = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListStatusesByRef")) + RepoGetContentsList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetContentsList")) + RepoGetContents = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetContents")) + RepoCreateFile = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateFile")) + RepoDeleteFile = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteFile")) + RepoUpdateFile = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoUpdateFile")) + RepoApplyDiffPatch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoApplyDiffPatch")) + RepoGetEditorConfig = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetEditorConfig")) + ListForks = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: ListForks")) + CreateFork = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: CreateFork")) + GetBlob = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetBlob")) + RepoGetSingleCommit = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetSingleCommit")) + RepoDownloadCommitDiffOrPatch = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoDownloadCommitDiffOrPatch") + ) + RepoGetNote = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetNote")) + RepoListAllGitRefs = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListAllGitRefs")) + RepoListGitRefs = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListGitRefs")) + GetAnnotatedTag = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetAnnotatedTag")) + GetTree = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetTree")) + RepoListHooks = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListHooks")) + RepoCreateHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateHook")) + RepoListGitHooks = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListGitHooks")) + RepoGetGitHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetGitHook")) + RepoDeleteGitHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteGitHook")) + RepoEditGitHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoEditGitHook")) + RepoGetHook = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetHook")) + RepoDeleteHook = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteHook")) + RepoEditHook = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoEditHook")) + RepoTestHook = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoTestHook")) + RepoGetIssueTemplates = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetIssueTemplates")) + IssueListIssues = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueListIssues")) + IssueCreateIssue = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueCreateIssue")) + IssueGetRepoComments = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetRepoComments")) + IssueDeleteComment = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteComment")) + IssueListIssueCommentAttachments = + (fun _ -> + raise ( + System.NotImplementedException "Unimplemented mock function: IssueListIssueCommentAttachments" + ) + ) + IssueGetIssueCommentAttachment = + (fun _ -> + raise ( + System.NotImplementedException "Unimplemented mock function: IssueGetIssueCommentAttachment" + ) + ) + IssueDeleteIssueCommentAttachment = + (fun _ -> + raise ( + System.NotImplementedException "Unimplemented mock function: IssueDeleteIssueCommentAttachment" + ) + ) + IssueEditIssueCommentAttachment = + (fun _ -> + raise ( + System.NotImplementedException "Unimplemented mock function: IssueEditIssueCommentAttachment" + ) + ) + IssueGetCommentReactions = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueGetCommentReactions") + ) + IssueDeleteCommentReaction = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteCommentReaction") + ) + IssueGetIssue = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetIssue")) + IssueDelete = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueDelete")) + IssueEditIssue = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueEditIssue")) + IssueListIssueAttachments = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueListIssueAttachments") + ) + IssueGetIssueAttachment = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetIssueAttachment")) + IssueDeleteIssueAttachment = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteIssueAttachment") + ) + IssueEditIssueAttachment = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueEditIssueAttachment") + ) + IssueGetComments = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetComments")) + IssueCreateComment = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueCreateComment")) + IssueDeleteCommentDeprecated = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteCommentDeprecated") + ) + IssueEditIssueDeadline = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueEditIssueDeadline")) + IssueGetLabels = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetLabels")) + IssueAddLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueAddLabel")) + IssueClearLabels = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueClearLabels")) + IssueReplaceLabels = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueReplaceLabels")) + IssueRemoveLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueRemoveLabel")) + IssueGetIssueReactions = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetIssueReactions")) + IssueDeleteIssueReaction = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteIssueReaction") + ) + IssueDeleteStopWatch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteStopWatch")) + IssueStartStopWatch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueStartStopWatch")) + IssueStopStopWatch = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueStopStopWatch")) + IssueSubscriptions = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueSubscriptions")) + IssueCheckSubscription = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueCheckSubscription")) + IssueGetCommentsAndTimeline = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: IssueGetCommentsAndTimeline") + ) + IssueTrackedTimes = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueTrackedTimes")) + IssueAddTime = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueAddTime")) + IssueResetTime = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueResetTime")) + IssueDeleteTime = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteTime")) + RepoListKeys = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListKeys")) + RepoCreateKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateKey")) + RepoGetKey = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetKey")) + RepoDeleteKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteKey")) + IssueListLabels = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueListLabels")) + IssueCreateLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueCreateLabel")) + IssueGetLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetLabel")) + IssueDeleteLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteLabel")) + IssueEditLabel = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueEditLabel")) + RepoGetLanguages = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetLanguages")) + RepoGetRawFileOrLFS = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetRawFileOrLFS")) + IssueGetMilestonesList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetMilestonesList")) + IssueCreateMilestone = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueCreateMilestone")) + IssueGetMilestone = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueGetMilestone")) + IssueDeleteMilestone = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueDeleteMilestone")) + IssueEditMilestone = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: IssueEditMilestone")) + RepoMirrorSync = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoMirrorSync")) + NotifyGetRepoList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyGetRepoList")) + NotifyReadRepoList = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: NotifyReadRepoList")) + RepoListPullRequests = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListPullRequests")) + RepoCreatePullRequest = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreatePullRequest")) + RepoGetPullRequest = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetPullRequest")) + RepoEditPullRequest = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoEditPullRequest")) + RepoDownloadPullDiffOrPatch = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoDownloadPullDiffOrPatch") + ) + RepoGetPullRequestCommits = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoGetPullRequestCommits") + ) + RepoGetPullRequestFiles = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetPullRequestFiles")) + RepoPullRequestIsMerged = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoPullRequestIsMerged")) + RepoMergePullRequest = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoMergePullRequest")) + RepoCancelScheduledAutoMerge = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoCancelScheduledAutoMerge") + ) + RepoCreatePullReviewRequests = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoCreatePullReviewRequests") + ) + RepoDeletePullReviewRequests = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoDeletePullReviewRequests") + ) + RepoListPullReviews = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListPullReviews")) + RepoCreatePullReview = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreatePullReview")) + RepoGetPullReview = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetPullReview")) + RepoSubmitPullReview = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoSubmitPullReview")) + RepoDeletePullReview = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeletePullReview")) + RepoGetPullReviewComments = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoGetPullReviewComments") + ) + RepoDismissPullReview = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDismissPullReview")) + RepoUnDismissPullReview = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoUnDismissPullReview")) + RepoUpdatePullRequest = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoUpdatePullRequest")) + RepoListPushMirrors = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListPushMirrors")) + RepoAddPushMirror = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoAddPushMirror")) + RepoPushMirrorSync = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoPushMirrorSync")) + RepoGetPushMirrorByRemoteName = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoGetPushMirrorByRemoteName") + ) + RepoDeletePushMirror = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeletePushMirror")) + RepoGetRawFile = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetRawFile")) + RepoListReleases = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListReleases")) + RepoCreateRelease = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateRelease")) + RepoGetLatestRelease = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetLatestRelease")) + RepoGetReleaseByTag = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetReleaseByTag")) + RepoDeleteReleaseByTag = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteReleaseByTag")) + RepoGetRelease = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetRelease")) + RepoDeleteRelease = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteRelease")) + RepoEditRelease = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoEditRelease")) + RepoListReleaseAttachments = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoListReleaseAttachments") + ) + RepoGetReleaseAttachment = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoGetReleaseAttachment") + ) + RepoDeleteReleaseAttachment = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteReleaseAttachment") + ) + RepoEditReleaseAttachment = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoEditReleaseAttachment") + ) + RepoGetReviewers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetReviewers")) + RepoSigningKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoSigningKey")) + RepoListStargazers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListStargazers")) + RepoListStatuses = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListStatuses")) + RepoCreateStatus = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateStatus")) + RepoListSubscribers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListSubscribers")) + UserCurrentCheckSubscription = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentCheckSubscription") + ) + UserCurrentDeleteSubscription = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentDeleteSubscription") + ) + UserCurrentPutSubscription = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentPutSubscription") + ) + RepoListTags = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListTags")) + RepoCreateTag = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateTag")) + RepoGetTag = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetTag")) + RepoDeleteTag = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteTag")) + RepoListTeams = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListTeams")) + RepoCheckTeam = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCheckTeam")) + RepoDeleteTeam = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteTeam")) + RepoAddTeam = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoAddTeam")) + RepoTrackedTimes = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoTrackedTimes")) + UserTrackedTimes = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserTrackedTimes")) + RepoListTopics = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoListTopics")) + RepoUpdateTopics = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoUpdateTopics")) + RepoDeleteTopic = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteTopic")) + RepoAddTopic = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoAddTopic")) + RepoTransfer = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoTransfer")) + AcceptRepoTransfer = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: AcceptRepoTransfer")) + RejectRepoTransfer = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RejectRepoTransfer")) + RepoCreateWikiPage = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoCreateWikiPage")) + RepoGetWikiPage = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetWikiPage")) + RepoDeleteWikiPage = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoDeleteWikiPage")) + RepoEditWikiPage = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoEditWikiPage")) + RepoGetWikiPages = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetWikiPages")) + RepoGetWikiPageRevisions = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: RepoGetWikiPageRevisions") + ) + GenerateRepo = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GenerateRepo")) + RepoGetByID = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: RepoGetByID")) + GetGeneralAPISettings = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetGeneralAPISettings")) + GetGeneralAttachmentSettings = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: GetGeneralAttachmentSettings") + ) + GetGeneralRepositorySettings = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: GetGeneralRepositorySettings") + ) + GetGeneralUISettings = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetGeneralUISettings")) + GetSigningKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetSigningKey")) + OrgGetTeam = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgGetTeam")) + OrgDeleteTeam = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgDeleteTeam")) + OrgEditTeam = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgEditTeam")) + OrgListTeamMembers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListTeamMembers")) + OrgListTeamMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListTeamMember")) + OrgRemoveTeamMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgRemoveTeamMember")) + OrgAddTeamMember = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgAddTeamMember")) + OrgListTeamRepos = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListTeamRepos")) + OrgListTeamRepo = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListTeamRepo")) + OrgRemoveTeamRepository = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgRemoveTeamRepository")) + OrgAddTeamRepository = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgAddTeamRepository")) + TopicSearch = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: TopicSearch")) + UserGetCurrent = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserGetCurrent")) + UserGetOauth2Application = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserGetOauth2Application") + ) + UserCreateOAuth2Application = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCreateOAuth2Application") + ) + UserGetOAuth2Application = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserGetOAuth2Application") + ) + UserDeleteOAuth2Application = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserDeleteOAuth2Application") + ) + UserUpdateOAuth2Application = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserUpdateOAuth2Application") + ) + UserListEmails = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListEmails")) + UserAddEmail = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserAddEmail")) + UserDeleteEmail = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserDeleteEmail")) + UserCurrentListFollowers = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentListFollowers") + ) + UserCurrentListFollowing = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentListFollowing") + ) + UserCurrentCheckFollowing = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentCheckFollowing") + ) + UserCurrentDeleteFollow = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentDeleteFollow")) + UserCurrentPutFollow = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentPutFollow")) + GetVerificationToken = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetVerificationToken")) + UserCurrentDeleteGPGKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentDeleteGPGKey")) + UserCurrentListKeys = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentListKeys")) + UserCurrentPostKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentPostKey")) + UserCurrentGetKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentGetKey")) + UserCurrentDeleteKey = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentDeleteKey")) + OrgListCurrentUserOrgs = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListCurrentUserOrgs")) + UserCurrentListRepos = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentListRepos")) + CreateCurrentUserRepo = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: CreateCurrentUserRepo")) + GetUserSettings = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetUserSettings")) + UpdateUserSettings = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UpdateUserSettings")) + UserCurrentListStarred = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentListStarred")) + UserCurrentCheckStarring = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentCheckStarring") + ) + UserCurrentDeleteStar = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentDeleteStar")) + UserCurrentPutStar = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentPutStar")) + UserGetStopWatches = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserGetStopWatches")) + UserCurrentListSubscriptions = + (fun _ -> + raise (System.NotImplementedException "Unimplemented mock function: UserCurrentListSubscriptions") + ) + UserListTeams = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListTeams")) + UserCurrentTrackedTimes = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCurrentTrackedTimes")) + UserSearch = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserSearch")) + UserGet = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserGet")) + UserListFollowers = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListFollowers")) + UserListFollowing = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListFollowing")) + UserCheckFollowing = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCheckFollowing")) + UserGetHeatmapData = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserGetHeatmapData")) + UserListKeys = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListKeys")) + OrgListUserOrgs = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgListUserOrgs")) + OrgGetUserPermissions = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: OrgGetUserPermissions")) + UserListRepos = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListRepos")) + UserListStarred = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListStarred")) + UserListSubscriptions = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserListSubscriptions")) + UserGetTokens = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserGetTokens")) + UserCreateToken = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserCreateToken")) + UserDeleteAccessToken = + (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: UserDeleteAccessToken")) + GetVersion = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: GetVersion")) + } + + interface IGitea with + member this.ActivitypubPerson (arg_0_0, arg_0_1) = + this.ActivitypubPerson (arg_0_0, arg_0_1) + + member this.ActivitypubPersonInbox (arg_0_0, arg_0_1) = + this.ActivitypubPersonInbox (arg_0_0, arg_0_1) + + member this.AdminCronList (arg_0_0, arg_0_1, arg_0_2) = + this.AdminCronList (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminCronRun (arg_0_0, arg_0_1) = this.AdminCronRun (arg_0_0, arg_0_1) + + member this.AdminListHooks (arg_0_0, arg_0_1, arg_0_2) = + this.AdminListHooks (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminCreateHook (arg_0_0, arg_0_1) = this.AdminCreateHook (arg_0_0, arg_0_1) + member this.AdminGetHook (arg_0_0, arg_0_1) = this.AdminGetHook (arg_0_0, arg_0_1) + + member this.AdminEditHook (arg_0_0, arg_0_1, arg_0_2) = + this.AdminEditHook (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminGetAllOrgs (arg_0_0, arg_0_1, arg_0_2) = + this.AdminGetAllOrgs (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminUnadoptedList (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.AdminUnadoptedList (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.AdminAdoptRepository (arg_0_0, arg_0_1, arg_0_2) = + this.AdminAdoptRepository (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminDeleteUnadoptedRepository (arg_0_0, arg_0_1, arg_0_2) = + this.AdminDeleteUnadoptedRepository (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminGetAllUsers (arg_0_0, arg_0_1, arg_0_2) = + this.AdminGetAllUsers (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminCreateUser (arg_0_0, arg_0_1) = this.AdminCreateUser (arg_0_0, arg_0_1) + + member this.AdminDeleteUser (arg_0_0, arg_0_1, arg_0_2) = + this.AdminDeleteUser (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminEditUser (arg_0_0, arg_0_1, arg_0_2) = + this.AdminEditUser (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminCreatePublicKey (arg_0_0, arg_0_1, arg_0_2) = + this.AdminCreatePublicKey (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminDeleteUserPublicKey (arg_0_0, arg_0_1, arg_0_2) = + this.AdminDeleteUserPublicKey (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminCreateOrg (arg_0_0, arg_0_1, arg_0_2) = + this.AdminCreateOrg (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminCreateRepo (arg_0_0, arg_0_1, arg_0_2) = + this.AdminCreateRepo (arg_0_0, arg_0_1, arg_0_2) + + member this.AdminDeleteHook (arg_0_0, arg_0_1) = this.AdminDeleteHook (arg_0_0, arg_0_1) + member this.RenderMarkdown (arg_0_0, arg_0_1) = this.RenderMarkdown (arg_0_0, arg_0_1) + + member this.RenderMarkdownRaw (arg_0_0, arg_0_1) = + this.RenderMarkdownRaw (arg_0_0, arg_0_1) + + member this.GetNodeInfo arg_0_0 = this.GetNodeInfo (arg_0_0) + + member this.NotifyGetList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.NotifyGetList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.NotifyReadList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.NotifyReadList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.NotifyNewAvailable arg_0_0 = this.NotifyNewAvailable (arg_0_0) + member this.NotifyGetThread (arg_0_0, arg_0_1) = this.NotifyGetThread (arg_0_0, arg_0_1) + + member this.NotifyReadThread (arg_0_0, arg_0_1, arg_0_2) = + this.NotifyReadThread (arg_0_0, arg_0_1, arg_0_2) + + member this.CreateOrgRepoDeprecated (arg_0_0, arg_0_1, arg_0_2) = + this.CreateOrgRepoDeprecated (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgGetAll (arg_0_0, arg_0_1, arg_0_2) = + this.OrgGetAll (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgCreate (arg_0_0, arg_0_1) = this.OrgCreate (arg_0_0, arg_0_1) + member this.OrgGet (arg_0_0, arg_0_1) = this.OrgGet (arg_0_0, arg_0_1) + member this.OrgDelete (arg_0_0, arg_0_1) = this.OrgDelete (arg_0_0, arg_0_1) + + member this.OrgEdit (arg_0_0, arg_0_1, arg_0_2) = + this.OrgEdit (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgListHooks (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListHooks (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgCreateHook (arg_0_0, arg_0_1, arg_0_2) = + this.OrgCreateHook (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgGetHook (arg_0_0, arg_0_1, arg_0_2) = + this.OrgGetHook (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgDeleteHook (arg_0_0, arg_0_1, arg_0_2) = + this.OrgDeleteHook (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgEditHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgEditHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgListLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgCreateLabel (arg_0_0, arg_0_1, arg_0_2) = + this.OrgCreateLabel (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgGetLabel (arg_0_0, arg_0_1, arg_0_2) = + this.OrgGetLabel (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgDeleteLabel (arg_0_0, arg_0_1, arg_0_2) = + this.OrgDeleteLabel (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgEditLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgEditLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgListMembers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListMembers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgIsMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgIsMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgDeleteMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgDeleteMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgListPublicMembers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListPublicMembers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgIsPublicMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgIsPublicMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgConcealMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgConcealMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgPublicizeMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgPublicizeMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgListRepos (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListRepos (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.CreateOrgRepo (arg_0_0, arg_0_1, arg_0_2) = + this.CreateOrgRepo (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgListTeams (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListTeams (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgCreateTeam (arg_0_0, arg_0_1, arg_0_2) = + this.OrgCreateTeam (arg_0_0, arg_0_1, arg_0_2) + + member this.TeamSearch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.TeamSearch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.ListPackages (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.ListPackages (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.GetPackage (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.GetPackage (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.DeletePackage (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.DeletePackage (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.ListPackageFiles (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.ListPackageFiles (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueSearchIssues + ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9, + arg_0_10, + arg_0_11, + arg_0_12, + arg_0_13, + arg_0_14, + arg_0_15, + arg_0_16 + ) + = + this.IssueSearchIssues ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9, + arg_0_10, + arg_0_11, + arg_0_12, + arg_0_13, + arg_0_14, + arg_0_15, + arg_0_16 + ) + + member this.RepoMigrate (arg_0_0, arg_0_1) = this.RepoMigrate (arg_0_0, arg_0_1) + + member this.RepoSearch + ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9, + arg_0_10, + arg_0_11, + arg_0_12, + arg_0_13, + arg_0_14, + arg_0_15, + arg_0_16, + arg_0_17 + ) + = + this.RepoSearch ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9, + arg_0_10, + arg_0_11, + arg_0_12, + arg_0_13, + arg_0_14, + arg_0_15, + arg_0_16, + arg_0_17 + ) + + member this.RepoGet (arg_0_0, arg_0_1, arg_0_2) = + this.RepoGet (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoDelete (arg_0_0, arg_0_1, arg_0_2) = + this.RepoDelete (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoEdit (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoEdit (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetArchive (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetArchive (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetAssignees (arg_0_0, arg_0_1, arg_0_2) = + this.RepoGetAssignees (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoListBranchProtection (arg_0_0, arg_0_1, arg_0_2) = + this.RepoListBranchProtection (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoCreateBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoEditBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoEditBranchProtection (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListBranches (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListBranches (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoCreateBranch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateBranch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetBranch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetBranch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteBranch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteBranch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoListCollaborators (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListCollaborators (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoCheckCollaborator (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCheckCollaborator (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteCollaborator (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteCollaborator (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoAddCollaborator (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoAddCollaborator (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetRepoPermissions (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetRepoPermissions (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetAllCommits (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.RepoGetAllCommits (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.RepoGetCombinedStatusByRef (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoGetCombinedStatusByRef (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoListStatusesByRef (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.RepoListStatusesByRef (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.RepoGetContentsList (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetContentsList (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetContents (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetContents (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoCreateFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoCreateFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoDeleteFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoDeleteFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoUpdateFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoUpdateFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoApplyDiffPatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoApplyDiffPatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetEditorConfig (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetEditorConfig (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.ListForks (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.ListForks (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.CreateFork (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.CreateFork (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.GetBlob (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.GetBlob (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetSingleCommit (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetSingleCommit (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDownloadCommitDiffOrPatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoDownloadCommitDiffOrPatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetNote (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetNote (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoListAllGitRefs (arg_0_0, arg_0_1, arg_0_2) = + this.RepoListAllGitRefs (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoListGitRefs (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoListGitRefs (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.GetAnnotatedTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.GetAnnotatedTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.GetTree (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) = + this.GetTree (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) + + member this.RepoListHooks (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListHooks (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoCreateHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoListGitHooks (arg_0_0, arg_0_1, arg_0_2) = + this.RepoListGitHooks (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoGetGitHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetGitHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteGitHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteGitHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoEditGitHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoEditGitHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoEditHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoEditHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoTestHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoTestHook (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetIssueTemplates (arg_0_0, arg_0_1, arg_0_2) = + this.RepoGetIssueTemplates (arg_0_0, arg_0_1, arg_0_2) + + member this.IssueListIssues + ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9, + arg_0_10, + arg_0_11, + arg_0_12, + arg_0_13, + arg_0_14 + ) + = + this.IssueListIssues ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9, + arg_0_10, + arg_0_11, + arg_0_12, + arg_0_13, + arg_0_14 + ) + + member this.IssueCreateIssue (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueCreateIssue (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueGetRepoComments (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) = + this.IssueGetRepoComments (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) + + member this.IssueDeleteComment (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueDeleteComment (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueListIssueCommentAttachments (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueListIssueCommentAttachments (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueGetIssueCommentAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueGetIssueCommentAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueDeleteIssueCommentAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueDeleteIssueCommentAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueEditIssueCommentAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.IssueEditIssueCommentAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.IssueGetCommentReactions (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueGetCommentReactions (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueDeleteCommentReaction (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueDeleteCommentReaction (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueGetIssue (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueGetIssue (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueDelete (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueDelete (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueEditIssue (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueEditIssue (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueListIssueAttachments (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueListIssueAttachments (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueGetIssueAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueGetIssueAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueDeleteIssueAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueDeleteIssueAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueEditIssueAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.IssueEditIssueAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.IssueGetComments (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.IssueGetComments (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.IssueCreateComment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueCreateComment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueDeleteCommentDeprecated (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueDeleteCommentDeprecated (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueEditIssueDeadline (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueEditIssueDeadline (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueGetLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueGetLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueAddLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueAddLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueClearLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueClearLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueReplaceLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueReplaceLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueRemoveLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueRemoveLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueGetIssueReactions (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.IssueGetIssueReactions (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.IssueDeleteIssueReaction (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueDeleteIssueReaction (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueDeleteStopWatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueDeleteStopWatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueStartStopWatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueStartStopWatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueStopStopWatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueStopStopWatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueSubscriptions (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.IssueSubscriptions (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.IssueCheckSubscription (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueCheckSubscription (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueGetCommentsAndTimeline + (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + = + this.IssueGetCommentsAndTimeline (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.IssueTrackedTimes + (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7, arg_0_8) + = + this.IssueTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7, arg_0_8) + + member this.IssueAddTime (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueAddTime (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueResetTime (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueResetTime (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueDeleteTime (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueDeleteTime (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListKeys (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) = + this.RepoListKeys (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) + + member this.RepoCreateKey (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateKey (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetKey (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetKey (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteKey (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteKey (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueListLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueListLabels (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueCreateLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueCreateLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueGetLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueGetLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueDeleteLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueDeleteLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueEditLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueEditLabel (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetLanguages (arg_0_0, arg_0_1, arg_0_2) = + this.RepoGetLanguages (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoGetRawFileOrLFS (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetRawFileOrLFS (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.IssueGetMilestonesList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) = + this.IssueGetMilestonesList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) + + member this.IssueCreateMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueCreateMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueGetMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueGetMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueDeleteMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.IssueDeleteMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.IssueEditMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.IssueEditMilestone (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoMirrorSync (arg_0_0, arg_0_1, arg_0_2) = + this.RepoMirrorSync (arg_0_0, arg_0_1, arg_0_2) + + member this.NotifyGetRepoList + (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7, arg_0_8, arg_0_9) + = + this.NotifyGetRepoList ( + arg_0_0, + arg_0_1, + arg_0_2, + arg_0_3, + arg_0_4, + arg_0_5, + arg_0_6, + arg_0_7, + arg_0_8, + arg_0_9 + ) + + member this.NotifyReadRepoList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) = + this.NotifyReadRepoList (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6) + + member this.RepoListPullRequests + (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7, arg_0_8) + = + this.RepoListPullRequests (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7, arg_0_8) + + member this.RepoCreatePullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreatePullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetPullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetPullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoEditPullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoEditPullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoDownloadPullDiffOrPatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoDownloadPullDiffOrPatch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoGetPullRequestCommits (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoGetPullRequestCommits (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoGetPullRequestFiles (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.RepoGetPullRequestFiles (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.RepoPullRequestIsMerged (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoPullRequestIsMerged (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoMergePullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoMergePullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoCancelScheduledAutoMerge (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCancelScheduledAutoMerge (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoCreatePullReviewRequests (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoCreatePullReviewRequests (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoDeletePullReviewRequests (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoDeletePullReviewRequests (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListPullReviews (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoListPullReviews (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoCreatePullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoCreatePullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoSubmitPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoSubmitPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoDeletePullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoDeletePullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetPullReviewComments (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetPullReviewComments (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoDismissPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoDismissPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoUnDismissPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoUnDismissPullReview (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoUpdatePullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoUpdatePullRequest (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListPushMirrors (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListPushMirrors (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoAddPushMirror (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoAddPushMirror (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoPushMirrorSync (arg_0_0, arg_0_1, arg_0_2) = + this.RepoPushMirrorSync (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoGetPushMirrorByRemoteName (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetPushMirrorByRemoteName (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeletePushMirror (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeletePushMirror (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetRawFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetRawFile (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListReleases (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.RepoListReleases (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.RepoCreateRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetLatestRelease (arg_0_0, arg_0_1, arg_0_2) = + this.RepoGetLatestRelease (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoGetReleaseByTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetReleaseByTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteReleaseByTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteReleaseByTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoEditRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoEditRelease (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListReleaseAttachments (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoListReleaseAttachments (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetReleaseAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetReleaseAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoDeleteReleaseAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoDeleteReleaseAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoEditReleaseAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) = + this.RepoEditReleaseAttachment (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5) + + member this.RepoGetReviewers (arg_0_0, arg_0_1, arg_0_2) = + this.RepoGetReviewers (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoSigningKey (arg_0_0, arg_0_1, arg_0_2) = + this.RepoSigningKey (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoListStargazers (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListStargazers (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListStatuses (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.RepoListStatuses (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.RepoCreateStatus (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoCreateStatus (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoListSubscribers (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListSubscribers (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.UserCurrentCheckSubscription (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentCheckSubscription (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentDeleteSubscription (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentDeleteSubscription (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentPutSubscription (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentPutSubscription (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoListTags (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListTags (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoCreateTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteTag (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoListTeams (arg_0_0, arg_0_1, arg_0_2) = + this.RepoListTeams (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoCheckTeam (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCheckTeam (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteTeam (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteTeam (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoAddTeam (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoAddTeam (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) = + this.RepoTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4, arg_0_5, arg_0_6, arg_0_7) + + member this.UserTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoListTopics (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoListTopics (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoUpdateTopics (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoUpdateTopics (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteTopic (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteTopic (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoAddTopic (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoAddTopic (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoTransfer (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoTransfer (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.AcceptRepoTransfer (arg_0_0, arg_0_1, arg_0_2) = + this.AcceptRepoTransfer (arg_0_0, arg_0_1, arg_0_2) + + member this.RejectRepoTransfer (arg_0_0, arg_0_1, arg_0_2) = + this.RejectRepoTransfer (arg_0_0, arg_0_1, arg_0_2) + + member this.RepoCreateWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoCreateWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoGetWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoDeleteWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.RepoDeleteWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoEditWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoEditWikiPage (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetWikiPages (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetWikiPages (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.RepoGetWikiPageRevisions (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.RepoGetWikiPageRevisions (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.GenerateRepo (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.GenerateRepo (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.RepoGetByID (arg_0_0, arg_0_1) = this.RepoGetByID (arg_0_0, arg_0_1) + member this.GetGeneralAPISettings arg_0_0 = this.GetGeneralAPISettings (arg_0_0) + + member this.GetGeneralAttachmentSettings arg_0_0 = + this.GetGeneralAttachmentSettings (arg_0_0) + + member this.GetGeneralRepositorySettings arg_0_0 = + this.GetGeneralRepositorySettings (arg_0_0) + + member this.GetGeneralUISettings arg_0_0 = this.GetGeneralUISettings (arg_0_0) + member this.GetSigningKey arg_0_0 = this.GetSigningKey (arg_0_0) + member this.OrgGetTeam (arg_0_0, arg_0_1) = this.OrgGetTeam (arg_0_0, arg_0_1) + member this.OrgDeleteTeam (arg_0_0, arg_0_1) = this.OrgDeleteTeam (arg_0_0, arg_0_1) + + member this.OrgEditTeam (arg_0_0, arg_0_1, arg_0_2) = + this.OrgEditTeam (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgListTeamMembers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListTeamMembers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgListTeamMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgListTeamMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgRemoveTeamMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgRemoveTeamMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgAddTeamMember (arg_0_0, arg_0_1, arg_0_2) = + this.OrgAddTeamMember (arg_0_0, arg_0_1, arg_0_2) + + member this.OrgListTeamRepos (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListTeamRepos (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgListTeamRepo (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListTeamRepo (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgRemoveTeamRepository (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgRemoveTeamRepository (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgAddTeamRepository (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgAddTeamRepository (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.TopicSearch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.TopicSearch (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserGetCurrent arg_0_0 = this.UserGetCurrent (arg_0_0) + + member this.UserGetOauth2Application (arg_0_0, arg_0_1, arg_0_2) = + this.UserGetOauth2Application (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCreateOAuth2Application (arg_0_0, arg_0_1) = + this.UserCreateOAuth2Application (arg_0_0, arg_0_1) + + member this.UserGetOAuth2Application (arg_0_0, arg_0_1) = + this.UserGetOAuth2Application (arg_0_0, arg_0_1) + + member this.UserDeleteOAuth2Application (arg_0_0, arg_0_1) = + this.UserDeleteOAuth2Application (arg_0_0, arg_0_1) + + member this.UserUpdateOAuth2Application (arg_0_0, arg_0_1, arg_0_2) = + this.UserUpdateOAuth2Application (arg_0_0, arg_0_1, arg_0_2) + + member this.UserListEmails arg_0_0 = this.UserListEmails (arg_0_0) + member this.UserAddEmail (arg_0_0, arg_0_1) = this.UserAddEmail (arg_0_0, arg_0_1) + member this.UserDeleteEmail (arg_0_0, arg_0_1) = this.UserDeleteEmail (arg_0_0, arg_0_1) + + member this.UserCurrentListFollowers (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentListFollowers (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentListFollowing (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentListFollowing (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentCheckFollowing (arg_0_0, arg_0_1) = + this.UserCurrentCheckFollowing (arg_0_0, arg_0_1) + + member this.UserCurrentDeleteFollow (arg_0_0, arg_0_1) = + this.UserCurrentDeleteFollow (arg_0_0, arg_0_1) + + member this.UserCurrentPutFollow (arg_0_0, arg_0_1) = + this.UserCurrentPutFollow (arg_0_0, arg_0_1) + + member this.GetVerificationToken arg_0_0 = this.GetVerificationToken (arg_0_0) + + member this.UserCurrentDeleteGPGKey (arg_0_0, arg_0_1) = + this.UserCurrentDeleteGPGKey (arg_0_0, arg_0_1) + + member this.UserCurrentListKeys (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserCurrentListKeys (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserCurrentPostKey (arg_0_0, arg_0_1) = + this.UserCurrentPostKey (arg_0_0, arg_0_1) + + member this.UserCurrentGetKey (arg_0_0, arg_0_1) = + this.UserCurrentGetKey (arg_0_0, arg_0_1) + + member this.UserCurrentDeleteKey (arg_0_0, arg_0_1) = + this.UserCurrentDeleteKey (arg_0_0, arg_0_1) + + member this.OrgListCurrentUserOrgs (arg_0_0, arg_0_1, arg_0_2) = + this.OrgListCurrentUserOrgs (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentListRepos (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentListRepos (arg_0_0, arg_0_1, arg_0_2) + + member this.CreateCurrentUserRepo (arg_0_0, arg_0_1) = + this.CreateCurrentUserRepo (arg_0_0, arg_0_1) + + member this.GetUserSettings arg_0_0 = this.GetUserSettings (arg_0_0) + + member this.UpdateUserSettings (arg_0_0, arg_0_1) = + this.UpdateUserSettings (arg_0_0, arg_0_1) + + member this.UserCurrentListStarred (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentListStarred (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentCheckStarring (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentCheckStarring (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentDeleteStar (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentDeleteStar (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentPutStar (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentPutStar (arg_0_0, arg_0_1, arg_0_2) + + member this.UserGetStopWatches (arg_0_0, arg_0_1, arg_0_2) = + this.UserGetStopWatches (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentListSubscriptions (arg_0_0, arg_0_1, arg_0_2) = + this.UserCurrentListSubscriptions (arg_0_0, arg_0_1, arg_0_2) + + member this.UserListTeams (arg_0_0, arg_0_1, arg_0_2) = + this.UserListTeams (arg_0_0, arg_0_1, arg_0_2) + + member this.UserCurrentTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.UserCurrentTrackedTimes (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.UserSearch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.UserSearch (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.UserGet (arg_0_0, arg_0_1) = this.UserGet (arg_0_0, arg_0_1) + + member this.UserListFollowers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserListFollowers (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserListFollowing (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserListFollowing (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserCheckFollowing (arg_0_0, arg_0_1, arg_0_2) = + this.UserCheckFollowing (arg_0_0, arg_0_1, arg_0_2) + + member this.UserGetHeatmapData (arg_0_0, arg_0_1) = + this.UserGetHeatmapData (arg_0_0, arg_0_1) + + member this.UserListKeys (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) = + this.UserListKeys (arg_0_0, arg_0_1, arg_0_2, arg_0_3, arg_0_4) + + member this.OrgListUserOrgs (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.OrgListUserOrgs (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.OrgGetUserPermissions (arg_0_0, arg_0_1, arg_0_2) = + this.OrgGetUserPermissions (arg_0_0, arg_0_1, arg_0_2) + + member this.UserListRepos (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserListRepos (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserListStarred (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserListStarred (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserListSubscriptions (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserListSubscriptions (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserGetTokens (arg_0_0, arg_0_1, arg_0_2, arg_0_3) = + this.UserGetTokens (arg_0_0, arg_0_1, arg_0_2, arg_0_3) + + member this.UserCreateToken (arg_0_0, arg_0_1, arg_0_2) = + this.UserCreateToken (arg_0_0, arg_0_1, arg_0_2) + + member this.UserDeleteAccessToken (arg_0_0, arg_0_1, arg_0_2) = + this.UserDeleteAccessToken (arg_0_0, arg_0_1, arg_0_2) + + member this.GetVersion arg_0_0 = this.GetVersion (arg_0_0) + +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the APIError type +[] +module APIErrorJsonSerializeExtension = + /// Extension methods for JSON parsing + type APIError with + + /// Serialize to a JSON node + static member toJsonNode (input : APIError) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the AccessToken type +[] +module AccessTokenJsonSerializeExtension = + /// Extension methods for JSON parsing + type AccessToken with + + /// Serialize to a JSON node + static member toJsonNode (input : AccessToken) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "scopes", + (input.Scopes + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha1", + (input.Sha1 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "token_last_eight", + (input.TokenLastEight + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the ActivityPub type +[] +module ActivityPubJsonSerializeExtension = + /// Extension methods for JSON parsing + type ActivityPub with + + /// Serialize to a JSON node + static member toJsonNode (input : ActivityPub) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "@context", + (input.Context + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the AddCollaboratorOption type +[] +module AddCollaboratorOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type AddCollaboratorOption with + + /// Serialize to a JSON node + static member toJsonNode (input : AddCollaboratorOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "permission", + (input.Permission + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the AddTimeOption type +[] +module AddTimeOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type AddTimeOption with + + /// Serialize to a JSON node + static member toJsonNode (input : AddTimeOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("time", (input.Time |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "user_name", + (input.UserName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the AnnotatedTagObject type +[] +module AnnotatedTagObjectJsonSerializeExtension = + /// Extension methods for JSON parsing + type AnnotatedTagObject with + + /// Serialize to a JSON node + static member toJsonNode (input : AnnotatedTagObject) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Attachment type +[] +module AttachmentJsonSerializeExtension = + /// Extension methods for JSON parsing + type Attachment with + + /// Serialize to a JSON node + static member toJsonNode (input : Attachment) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "browser_download_url", + (input.BrowserDownloadUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "download_count", + (input.DownloadCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "size", + (input.Size + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "uuid", + (input.Uuid + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the BranchProtection type +[] +module BranchProtectionJsonSerializeExtension = + /// Extension methods for JSON parsing + type BranchProtection with + + /// Serialize to a JSON node + static member toJsonNode (input : BranchProtection) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "approvals_whitelist_teams", + (input.ApprovalsWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "approvals_whitelist_username", + (input.ApprovalsWhitelistUsername + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_official_review_requests", + (input.BlockOnOfficialReviewRequests + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_outdated_branch", + (input.BlockOnOutdatedBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_rejected_reviews", + (input.BlockOnRejectedReviews + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "branch_name", + (input.BranchName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "dismiss_stale_approvals", + (input.DismissStaleApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_approvals_whitelist", + (input.EnableApprovalsWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_merge_whitelist", + (input.EnableMergeWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_push", + (input.EnablePush + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_push_whitelist", + (input.EnablePushWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_status_check", + (input.EnableStatusCheck + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_whitelist_teams", + (input.MergeWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_whitelist_usernames", + (input.MergeWhitelistUsernames + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "protected_file_patterns", + (input.ProtectedFilePatterns + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_deploy_keys", + (input.PushWhitelistDeployKeys + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_teams", + (input.PushWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_usernames", + (input.PushWhitelistUsernames + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "require_signed_commits", + (input.RequireSignedCommits + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "required_approvals", + (input.RequiredApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "rule_name", + (input.RuleName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "status_check_contexts", + (input.StatusCheckContexts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "unprotected_file_patterns", + (input.UnprotectedFilePatterns + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the ChangedFile type +[] +module ChangedFileJsonSerializeExtension = + /// Extension methods for JSON parsing + type ChangedFile with + + /// Serialize to a JSON node + static member toJsonNode (input : ChangedFile) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "additions", + (input.Additions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "changes", + (input.Changes + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "contents_url", + (input.ContentsUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "deletions", + (input.Deletions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "filename", + (input.Filename + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "previous_filename", + (input.PreviousFilename + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "raw_url", + (input.RawUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "status", + (input.Status + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CommitAffectedFiles type +[] +module CommitAffectedFilesJsonSerializeExtension = + /// Extension methods for JSON parsing + type CommitAffectedFiles with + + /// Serialize to a JSON node + static member toJsonNode (input : CommitAffectedFiles) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "filename", + (input.Filename + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CommitDateOptions type +[] +module CommitDateOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type CommitDateOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : CommitDateOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CommitMeta type +[] +module CommitMetaJsonSerializeExtension = + /// Extension methods for JSON parsing + type CommitMeta with + + /// Serialize to a JSON node + static member toJsonNode (input : CommitMeta) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CommitStats type +[] +module CommitStatsJsonSerializeExtension = + /// Extension methods for JSON parsing + type CommitStats with + + /// Serialize to a JSON node + static member toJsonNode (input : CommitStats) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "additions", + (input.Additions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "deletions", + (input.Deletions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "total", + (input.Total + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CommitUser type +[] +module CommitUserJsonSerializeExtension = + /// Extension methods for JSON parsing + type CommitUser with + + /// Serialize to a JSON node + static member toJsonNode (input : CommitUser) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "date", + (input.Date + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateAccessTokenOption type +[] +module CreateAccessTokenOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateAccessTokenOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateAccessTokenOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("name", (input.Name |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "scopes", + (input.Scopes + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateBranchProtectionOption type +[] +module CreateBranchProtectionOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateBranchProtectionOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateBranchProtectionOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "approvals_whitelist_teams", + (input.ApprovalsWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "approvals_whitelist_username", + (input.ApprovalsWhitelistUsername + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_official_review_requests", + (input.BlockOnOfficialReviewRequests + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_outdated_branch", + (input.BlockOnOutdatedBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_rejected_reviews", + (input.BlockOnRejectedReviews + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "branch_name", + (input.BranchName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "dismiss_stale_approvals", + (input.DismissStaleApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_approvals_whitelist", + (input.EnableApprovalsWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_merge_whitelist", + (input.EnableMergeWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_push", + (input.EnablePush + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_push_whitelist", + (input.EnablePushWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_status_check", + (input.EnableStatusCheck + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_whitelist_teams", + (input.MergeWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_whitelist_usernames", + (input.MergeWhitelistUsernames + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "protected_file_patterns", + (input.ProtectedFilePatterns + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_deploy_keys", + (input.PushWhitelistDeployKeys + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_teams", + (input.PushWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_usernames", + (input.PushWhitelistUsernames + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "require_signed_commits", + (input.RequireSignedCommits + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "required_approvals", + (input.RequiredApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "rule_name", + (input.RuleName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "status_check_contexts", + (input.StatusCheckContexts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "unprotected_file_patterns", + (input.UnprotectedFilePatterns + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateBranchRepoOption type +[] +module CreateBranchRepoOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateBranchRepoOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateBranchRepoOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("new_branch_name", (input.NewBranchName |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "old_branch_name", + (input.OldBranchName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateEmailOption type +[] +module CreateEmailOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateEmailOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateEmailOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "emails", + (input.Emails + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateForkOption type +[] +module CreateForkOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateForkOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateForkOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "organization", + (input.Organization + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateGPGKeyOption type +[] +module CreateGPGKeyOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateGPGKeyOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateGPGKeyOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "armored_public_key", + (input.ArmoredPublicKey |> System.Text.Json.Nodes.JsonValue.Create) + ) + + node.Add ( + "armored_signature", + (input.ArmoredSignature + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateHookOptionConfig type +[] +module CreateHookOptionConfigJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateHookOptionConfig with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateHookOptionConfig) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateIssueCommentOption type +[] +module CreateIssueCommentOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateIssueCommentOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateIssueCommentOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("body", (input.Body |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateIssueOption type +[] +module CreateIssueOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateIssueOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateIssueOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignees", + (input.Assignees + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "closed", + (input.Closed + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref", + (input.Ref + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("title", (input.Title |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateKeyOption type +[] +module CreateKeyOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateKeyOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateKeyOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("key", (input.Key |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "read_only", + (input.ReadOnly + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("title", (input.Title |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateLabelOption type +[] +module CreateLabelOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateLabelOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateLabelOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("color", (input.Color |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "exclusive", + (input.Exclusive + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("name", (input.Name |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateMilestoneOption type +[] +module CreateMilestoneOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateMilestoneOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateMilestoneOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_on", + (input.DueOn + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateOAuth2ApplicationOptions type +[] +module CreateOAuth2ApplicationOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateOAuth2ApplicationOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateOAuth2ApplicationOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "confidential_client", + (input.ConfidentialClient + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "redirect_uris", + (input.RedirectUris + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateOrgOption type +[] +module CreateOrgOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateOrgOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateOrgOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_admin_change_team_access", + (input.RepoAdminChangeTeamAccess + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("username", (input.Username |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "visibility", + (input.Visibility + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreatePullRequestOption type +[] +module CreatePullRequestOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreatePullRequestOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreatePullRequestOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignees", + (input.Assignees + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "base", + (input.Base + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "head", + (input.Head + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreatePullReviewComment type +[] +module CreatePullReviewCommentJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreatePullReviewComment with + + /// Serialize to a JSON node + static member toJsonNode (input : CreatePullReviewComment) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "new_position", + (input.NewPosition + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "old_position", + (input.OldPosition + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "path", + (input.Path + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreatePushMirrorOption type +[] +module CreatePushMirrorOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreatePushMirrorOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreatePushMirrorOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "interval", + (input.Interval + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "remote_address", + (input.RemoteAddress + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "remote_password", + (input.RemotePassword + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "remote_username", + (input.RemoteUsername + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sync_on_commit", + (input.SyncOnCommit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateReleaseOption type +[] +module CreateReleaseOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateReleaseOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateReleaseOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "draft", + (input.Draft + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "prerelease", + (input.Prerelease + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("tag_name", (input.TagName |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "target_commitish", + (input.TargetCommitish + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateRepoOption type +[] +module CreateRepoOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateRepoOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateRepoOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "auto_init", + (input.AutoInit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_branch", + (input.DefaultBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "gitignores", + (input.Gitignores + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issue_labels", + (input.IssueLabels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "license", + (input.License + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("name", (input.Name |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "private", + (input.Private + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "readme", + (input.Readme + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "template", + (input.Template + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "trust_model", + (input.TrustModel + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateStatusOption type +[] +module CreateStatusOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateStatusOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateStatusOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "context", + (input.Context + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "target_url", + (input.TargetUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateTagOption type +[] +module CreateTagOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateTagOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateTagOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("tag_name", (input.TagName |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "target", + (input.Target + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type1 type +[] +module Type1JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type1 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type1) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateTeamOption type +[] +module CreateTeamOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateTeamOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateTeamOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "can_create_org_repo", + (input.CanCreateOrgRepo + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "includes_all_repositories", + (input.IncludesAllRepositories + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("name", (input.Name |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "permission", + (input.Permission + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "units", + (input.Units + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "units_map", + (input.UnitsMap + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type1.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateUserOption type +[] +module CreateUserOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateUserOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateUserOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("email", (input.Email |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "login_name", + (input.LoginName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "must_change_password", + (input.MustChangePassword + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("password", (input.Password |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "restricted", + (input.Restricted + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "send_notify", + (input.SendNotify + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "source_id", + (input.SourceId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("username", (input.Username |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "visibility", + (input.Visibility + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateWikiPageOptions type +[] +module CreateWikiPageOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateWikiPageOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateWikiPageOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "content_base64", + (input.ContentBase64 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Cron type +[] +module CronJsonSerializeExtension = + /// Extension methods for JSON parsing + type Cron with + + /// Serialize to a JSON node + static member toJsonNode (input : Cron) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "exec_times", + (input.ExecTimes + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "next", + (input.Next + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "prev", + (input.Prev + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "schedule", + (input.Schedule + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the DeleteEmailOption type +[] +module DeleteEmailOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type DeleteEmailOption with + + /// Serialize to a JSON node + static member toJsonNode (input : DeleteEmailOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "emails", + (input.Emails + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the DismissPullReviewOptions type +[] +module DismissPullReviewOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type DismissPullReviewOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : DismissPullReviewOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "priors", + (input.Priors + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditAttachmentOptions type +[] +module EditAttachmentOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditAttachmentOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : EditAttachmentOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditBranchProtectionOption type +[] +module EditBranchProtectionOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditBranchProtectionOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditBranchProtectionOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "approvals_whitelist_teams", + (input.ApprovalsWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "approvals_whitelist_username", + (input.ApprovalsWhitelistUsername + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_official_review_requests", + (input.BlockOnOfficialReviewRequests + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_outdated_branch", + (input.BlockOnOutdatedBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "block_on_rejected_reviews", + (input.BlockOnRejectedReviews + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "dismiss_stale_approvals", + (input.DismissStaleApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_approvals_whitelist", + (input.EnableApprovalsWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_merge_whitelist", + (input.EnableMergeWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_push", + (input.EnablePush + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_push_whitelist", + (input.EnablePushWhitelist + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_status_check", + (input.EnableStatusCheck + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_whitelist_teams", + (input.MergeWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_whitelist_usernames", + (input.MergeWhitelistUsernames + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "protected_file_patterns", + (input.ProtectedFilePatterns + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_deploy_keys", + (input.PushWhitelistDeployKeys + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_teams", + (input.PushWhitelistTeams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push_whitelist_usernames", + (input.PushWhitelistUsernames + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "require_signed_commits", + (input.RequireSignedCommits + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "required_approvals", + (input.RequiredApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "status_check_contexts", + (input.StatusCheckContexts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "unprotected_file_patterns", + (input.UnprotectedFilePatterns + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditDeadlineOption type +[] +module EditDeadlineOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditDeadlineOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditDeadlineOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("due_date", (input.DueDate |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditGitHookOption type +[] +module EditGitHookOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditGitHookOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditGitHookOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type2 type +[] +module Type2JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type2 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type2) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditHookOption type +[] +module EditHookOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditHookOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditHookOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "active", + (input.Active + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "authorization_header", + (input.AuthorizationHeader + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "branch_filter", + (input.BranchFilter + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "config", + (input.Config + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type2.toJsonNode field + )) + ) + + node.Add ( + "events", + (input.Events + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditIssueCommentOption type +[] +module EditIssueCommentOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditIssueCommentOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditIssueCommentOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("body", (input.Body |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditIssueOption type +[] +module EditIssueOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditIssueOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditIssueOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignees", + (input.Assignees + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref", + (input.Ref + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "unset_due_date", + (input.UnsetDueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditLabelOption type +[] +module EditLabelOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditLabelOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditLabelOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "color", + (input.Color + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "exclusive", + (input.Exclusive + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditMilestoneOption type +[] +module EditMilestoneOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditMilestoneOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditMilestoneOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_on", + (input.DueOn + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditOrgOption type +[] +module EditOrgOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditOrgOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditOrgOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_admin_change_team_access", + (input.RepoAdminChangeTeamAccess + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "visibility", + (input.Visibility + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditPullRequestOption type +[] +module EditPullRequestOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditPullRequestOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditPullRequestOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allow_maintainer_edit", + (input.AllowMaintainerEdit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignees", + (input.Assignees + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "base", + (input.Base + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "unset_due_date", + (input.UnsetDueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditReactionOption type +[] +module EditReactionOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditReactionOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditReactionOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditReleaseOption type +[] +module EditReleaseOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditReleaseOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditReleaseOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "draft", + (input.Draft + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "prerelease", + (input.Prerelease + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tag_name", + (input.TagName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "target_commitish", + (input.TargetCommitish + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type3 type +[] +module Type3JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type3 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type3) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditTeamOption type +[] +module EditTeamOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditTeamOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditTeamOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "can_create_org_repo", + (input.CanCreateOrgRepo + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "includes_all_repositories", + (input.IncludesAllRepositories + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("name", (input.Name |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "permission", + (input.Permission + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "units", + (input.Units + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "units_map", + (input.UnitsMap + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type3.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditUserOption type +[] +module EditUserOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditUserOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditUserOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "active", + (input.Active + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "admin", + (input.Admin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_create_organization", + (input.AllowCreateOrganization + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_git_hook", + (input.AllowGitHook + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_import_local", + (input.AllowImportLocal + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("login_name", (input.LoginName |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "max_repo_creation", + (input.MaxRepoCreation + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "must_change_password", + (input.MustChangePassword + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "password", + (input.Password + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "prohibit_login", + (input.ProhibitLogin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "restricted", + (input.Restricted + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("source_id", (input.SourceId |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "visibility", + (input.Visibility + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Email type +[] +module EmailJsonSerializeExtension = + /// Extension methods for JSON parsing + type Email with + + /// Serialize to a JSON node + static member toJsonNode (input : Email) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "primary", + (input.Primary + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "verified", + (input.Verified + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the ExternalTracker type +[] +module ExternalTrackerJsonSerializeExtension = + /// Extension methods for JSON parsing + type ExternalTracker with + + /// Serialize to a JSON node + static member toJsonNode (input : ExternalTracker) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "external_tracker_format", + (input.ExternalTrackerFormat + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "external_tracker_regexp_pattern", + (input.ExternalTrackerRegexpPattern + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "external_tracker_style", + (input.ExternalTrackerStyle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "external_tracker_url", + (input.ExternalTrackerUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the ExternalWiki type +[] +module ExternalWikiJsonSerializeExtension = + /// Extension methods for JSON parsing + type ExternalWiki with + + /// Serialize to a JSON node + static member toJsonNode (input : ExternalWiki) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "external_wiki_url", + (input.ExternalWikiUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the FileCommitResponse type +[] +module FileCommitResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type FileCommitResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : FileCommitResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "parents", + (input.Parents + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (CommitMeta.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tree", + (input.Tree + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitMeta.toJsonNode field + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the FileLinksResponse type +[] +module FileLinksResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type FileLinksResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : FileLinksResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "git", + (input.Git + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html", + (input.Html + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "self", + (input.Self + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GPGKeyEmail type +[] +module GPGKeyEmailJsonSerializeExtension = + /// Extension methods for JSON parsing + type GPGKeyEmail with + + /// Serialize to a JSON node + static member toJsonNode (input : GPGKeyEmail) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "verified", + (input.Verified + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GeneralAPISettings type +[] +module GeneralAPISettingsJsonSerializeExtension = + /// Extension methods for JSON parsing + type GeneralAPISettings with + + /// Serialize to a JSON node + static member toJsonNode (input : GeneralAPISettings) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "default_git_trees_per_page", + (input.DefaultGitTreesPerPage + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_max_blob_size", + (input.DefaultMaxBlobSize + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_paging_num", + (input.DefaultPagingNum + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "max_response_items", + (input.MaxResponseItems + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GeneralAttachmentSettings type +[] +module GeneralAttachmentSettingsJsonSerializeExtension = + /// Extension methods for JSON parsing + type GeneralAttachmentSettings with + + /// Serialize to a JSON node + static member toJsonNode (input : GeneralAttachmentSettings) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allowed_types", + (input.AllowedTypes + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enabled", + (input.Enabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "max_files", + (input.MaxFiles + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "max_size", + (input.MaxSize + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GeneralRepoSettings type +[] +module GeneralRepoSettingsJsonSerializeExtension = + /// Extension methods for JSON parsing + type GeneralRepoSettings with + + /// Serialize to a JSON node + static member toJsonNode (input : GeneralRepoSettings) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "http_git_disabled", + (input.HttpGitDisabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "lfs_disabled", + (input.LfsDisabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "migrations_disabled", + (input.MigrationsDisabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mirrors_disabled", + (input.MirrorsDisabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "stars_disabled", + (input.StarsDisabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "time_tracking_disabled", + (input.TimeTrackingDisabled + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GeneralUISettings type +[] +module GeneralUISettingsJsonSerializeExtension = + /// Extension methods for JSON parsing + type GeneralUISettings with + + /// Serialize to a JSON node + static member toJsonNode (input : GeneralUISettings) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allowed_reactions", + (input.AllowedReactions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "custom_emojis", + (input.CustomEmojis + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_theme", + (input.DefaultTheme + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GenerateRepoOption type +[] +module GenerateRepoOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type GenerateRepoOption with + + /// Serialize to a JSON node + static member toJsonNode (input : GenerateRepoOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "avatar", + (input.Avatar + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_branch", + (input.DefaultBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "git_content", + (input.GitContent + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "git_hooks", + (input.GitHooks + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("name", (input.Name |> System.Text.Json.Nodes.JsonValue.Create)) + node.Add ("owner", (input.Owner |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "private", + (input.Private + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "topics", + (input.Topics + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "webhooks", + (input.Webhooks + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GitBlobResponse type +[] +module GitBlobResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type GitBlobResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : GitBlobResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "encoding", + (input.Encoding + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "size", + (input.Size + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GitEntry type +[] +module GitEntryJsonSerializeExtension = + /// Extension methods for JSON parsing + type GitEntry with + + /// Serialize to a JSON node + static member toJsonNode (input : GitEntry) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "mode", + (input.Mode + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "path", + (input.Path + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "size", + (input.Size + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GitHook type +[] +module GitHookJsonSerializeExtension = + /// Extension methods for JSON parsing + type GitHook with + + /// Serialize to a JSON node + static member toJsonNode (input : GitHook) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "is_active", + (input.IsActive + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GitObject type +[] +module GitObjectJsonSerializeExtension = + /// Extension methods for JSON parsing + type GitObject with + + /// Serialize to a JSON node + static member toJsonNode (input : GitObject) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the GitTreeResponse type +[] +module GitTreeResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type GitTreeResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : GitTreeResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "page", + (input.Page + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "total_count", + (input.TotalCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tree", + (input.Tree + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (GitEntry.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "truncated", + (input.Truncated + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type4 type +[] +module Type4JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type4 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type4) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Hook type +[] +module HookJsonSerializeExtension = + /// Extension methods for JSON parsing + type Hook with + + /// Serialize to a JSON node + static member toJsonNode (input : Hook) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "active", + (input.Active + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "authorization_header", + (input.AuthorizationHeader + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "config", + (input.Config + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type4.toJsonNode field + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "events", + (input.Events + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Identity type +[] +module IdentityJsonSerializeExtension = + /// Extension methods for JSON parsing + type Identity with + + /// Serialize to a JSON node + static member toJsonNode (input : Identity) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the InternalTracker type +[] +module InternalTrackerJsonSerializeExtension = + /// Extension methods for JSON parsing + type InternalTracker with + + /// Serialize to a JSON node + static member toJsonNode (input : InternalTracker) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allow_only_contributors_to_track_time", + (input.AllowOnlyContributorsToTrackTime + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_issue_dependencies", + (input.EnableIssueDependencies + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_time_tracker", + (input.EnableTimeTracker + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the IssueDeadline type +[] +module IssueDeadlineJsonSerializeExtension = + /// Extension methods for JSON parsing + type IssueDeadline with + + /// Serialize to a JSON node + static member toJsonNode (input : IssueDeadline) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type5 type +[] +module Type5JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type5 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type5) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, (fun value -> System.Text.Json.Nodes.JsonObject ()) value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type6 type +[] +module Type6JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type6 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type6) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, (fun value -> System.Text.Json.Nodes.JsonObject ()) value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the IssueLabelsOption type +[] +module IssueLabelsOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type IssueLabelsOption with + + /// Serialize to a JSON node + static member toJsonNode (input : IssueLabelsOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Label type +[] +module LabelJsonSerializeExtension = + /// Extension methods for JSON parsing + type Label with + + /// Serialize to a JSON node + static member toJsonNode (input : Label) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "color", + (input.Color + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "exclusive", + (input.Exclusive + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the MarkdownOption type +[] +module MarkdownOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type MarkdownOption with + + /// Serialize to a JSON node + static member toJsonNode (input : MarkdownOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "Context", + (input.Context + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "Mode", + (input.Mode + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "Text", + (input.Text + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "Wiki", + (input.Wiki + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the MergePullRequestOption type +[] +module MergePullRequestOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type MergePullRequestOption with + + /// Serialize to a JSON node + static member toJsonNode (input : MergePullRequestOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("Do", (input.Do |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "MergeCommitID", + (input.MergeCommitID + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "MergeMessageField", + (input.MergeMessageField + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "MergeTitleField", + (input.MergeTitleField + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "delete_branch_after_merge", + (input.DeleteBranchAfterMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "force_merge", + (input.ForceMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "head_commit_id", + (input.HeadCommitId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_when_checks_succeed", + (input.MergeWhenChecksSucceed + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the MigrateRepoOptions type +[] +module MigrateRepoOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type MigrateRepoOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : MigrateRepoOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "auth_password", + (input.AuthPassword + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "auth_token", + (input.AuthToken + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "auth_username", + (input.AuthUsername + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("clone_addr", (input.CloneAddr |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issues", + (input.Issues + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "lfs", + (input.Lfs + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "lfs_endpoint", + (input.LfsEndpoint + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "milestones", + (input.Milestones + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mirror", + (input.Mirror + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mirror_interval", + (input.MirrorInterval + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "private", + (input.Private + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_requests", + (input.PullRequests + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "releases", + (input.Releases + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("repo_name", (input.RepoName |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "repo_owner", + (input.RepoOwner + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "service", + (input.Service + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "uid", + (input.Uid + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "wiki", + (input.Wiki + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type7 type +[] +module Type7JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type7 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type7) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NodeInfoServices type +[] +module NodeInfoServicesJsonSerializeExtension = + /// Extension methods for JSON parsing + type NodeInfoServices with + + /// Serialize to a JSON node + static member toJsonNode (input : NodeInfoServices) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "inbound", + (input.Inbound + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "outbound", + (input.Outbound + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NodeInfoSoftware type +[] +module NodeInfoSoftwareJsonSerializeExtension = + /// Extension methods for JSON parsing + type NodeInfoSoftware with + + /// Serialize to a JSON node + static member toJsonNode (input : NodeInfoSoftware) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "homepage", + (input.Homepage + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repository", + (input.Repository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "version", + (input.Version + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NodeInfoUsageUsers type +[] +module NodeInfoUsageUsersJsonSerializeExtension = + /// Extension methods for JSON parsing + type NodeInfoUsageUsers with + + /// Serialize to a JSON node + static member toJsonNode (input : NodeInfoUsageUsers) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "activeHalfyear", + (input.ActiveHalfyear + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "activeMonth", + (input.ActiveMonth + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "total", + (input.Total + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NotificationCount type +[] +module NotificationCountJsonSerializeExtension = + /// Extension methods for JSON parsing + type NotificationCount with + + /// Serialize to a JSON node + static member toJsonNode (input : NotificationCount) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "new", + (input.New + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the OAuth2Application type +[] +module OAuth2ApplicationJsonSerializeExtension = + /// Extension methods for JSON parsing + type OAuth2Application with + + /// Serialize to a JSON node + static member toJsonNode (input : OAuth2Application) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "client_id", + (input.ClientId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "client_secret", + (input.ClientSecret + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "confidential_client", + (input.ConfidentialClient + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "redirect_uris", + (input.RedirectUris + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Organization type +[] +module OrganizationJsonSerializeExtension = + /// Extension methods for JSON parsing + type Organization with + + /// Serialize to a JSON node + static member toJsonNode (input : Organization) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "avatar_url", + (input.AvatarUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_admin_change_team_access", + (input.RepoAdminChangeTeamAccess + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "username", + (input.Username + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "visibility", + (input.Visibility + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the OrganizationPermissions type +[] +module OrganizationPermissionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type OrganizationPermissions with + + /// Serialize to a JSON node + static member toJsonNode (input : OrganizationPermissions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "can_create_repository", + (input.CanCreateRepository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "can_read", + (input.CanRead + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "can_write", + (input.CanWrite + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "is_admin", + (input.IsAdmin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "is_owner", + (input.IsOwner + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PackageFile type +[] +module PackageFileJsonSerializeExtension = + /// Extension methods for JSON parsing + type PackageFile with + + /// Serialize to a JSON node + static member toJsonNode (input : PackageFile) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "Size", + (input.Size + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "md5", + (input.Md5 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha1", + (input.Sha1 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha256", + (input.Sha256 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha512", + (input.Sha512 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PayloadUser type +[] +module PayloadUserJsonSerializeExtension = + /// Extension methods for JSON parsing + type PayloadUser with + + /// Serialize to a JSON node + static member toJsonNode (input : PayloadUser) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "username", + (input.Username + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Permission type +[] +module PermissionJsonSerializeExtension = + /// Extension methods for JSON parsing + type Permission with + + /// Serialize to a JSON node + static member toJsonNode (input : Permission) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "admin", + (input.Admin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull", + (input.Pull + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "push", + (input.Push + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PullRequestMeta type +[] +module PullRequestMetaJsonSerializeExtension = + /// Extension methods for JSON parsing + type PullRequestMeta with + + /// Serialize to a JSON node + static member toJsonNode (input : PullRequestMeta) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "merged", + (input.Merged + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merged_at", + (input.MergedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PullReviewRequestOptions type +[] +module PullReviewRequestOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type PullReviewRequestOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : PullReviewRequestOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "reviewers", + (input.Reviewers + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "team_reviewers", + (input.TeamReviewers + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PushMirror type +[] +module PushMirrorJsonSerializeExtension = + /// Extension methods for JSON parsing + type PushMirror with + + /// Serialize to a JSON node + static member toJsonNode (input : PushMirror) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "interval", + (input.Interval + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "last_error", + (input.LastError + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "last_update", + (input.LastUpdate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "remote_address", + (input.RemoteAddress + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "remote_name", + (input.RemoteName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_name", + (input.RepoName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sync_on_commit", + (input.SyncOnCommit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Reference type +[] +module ReferenceJsonSerializeExtension = + /// Extension methods for JSON parsing + type Reference with + + /// Serialize to a JSON node + static member toJsonNode (input : Reference) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "object", + (input.Object + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> GitObject.toJsonNode field + )) + ) + + node.Add ( + "ref", + (input.Ref + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the RepoTopicOptions type +[] +module RepoTopicOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type RepoTopicOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : RepoTopicOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "topics", + (input.Topics + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the RepositoryMeta type +[] +module RepositoryMetaJsonSerializeExtension = + /// Extension methods for JSON parsing + type RepositoryMeta with + + /// Serialize to a JSON node + static member toJsonNode (input : RepositoryMeta) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "owner", + (input.Owner + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the ServerVersion type +[] +module ServerVersionJsonSerializeExtension = + /// Extension methods for JSON parsing + type ServerVersion with + + /// Serialize to a JSON node + static member toJsonNode (input : ServerVersion) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "version", + (input.Version + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the StopWatch type +[] +module StopWatchJsonSerializeExtension = + /// Extension methods for JSON parsing + type StopWatch with + + /// Serialize to a JSON node + static member toJsonNode (input : StopWatch) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "duration", + (input.Duration + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issue_index", + (input.IssueIndex + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issue_title", + (input.IssueTitle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_name", + (input.RepoName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_owner_name", + (input.RepoOwnerName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "seconds", + (input.Seconds + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the SubmitPullReviewOptions type +[] +module SubmitPullReviewOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type SubmitPullReviewOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : SubmitPullReviewOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "event", + (input.Event + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Tag type +[] +module TagJsonSerializeExtension = + /// Extension methods for JSON parsing + type Tag with + + /// Serialize to a JSON node + static member toJsonNode (input : Tag) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit", + (input.Commit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitMeta.toJsonNode field + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tarball_url", + (input.TarballUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "zipball_url", + (input.ZipballUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Type8 type +[] +module Type8JsonSerializeExtension = + /// Extension methods for JSON parsing + type Type8 with + + /// Serialize to a JSON node + static member toJsonNode (input : Type8) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Team type +[] +module TeamJsonSerializeExtension = + /// Extension methods for JSON parsing + type Team with + + /// Serialize to a JSON node + static member toJsonNode (input : Team) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "can_create_org_repo", + (input.CanCreateOrgRepo + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "includes_all_repositories", + (input.IncludesAllRepositories + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "organization", + (input.Organization + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Organization.toJsonNode field + )) + ) + + node.Add ( + "permission", + (input.Permission + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "units", + (input.Units + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "units_map", + (input.UnitsMap + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type8.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the TopicName type +[] +module TopicNameJsonSerializeExtension = + /// Extension methods for JSON parsing + type TopicName with + + /// Serialize to a JSON node + static member toJsonNode (input : TopicName) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "topics", + (input.Topics + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the TopicResponse type +[] +module TopicResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type TopicResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : TopicResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_count", + (input.RepoCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "topic_name", + (input.TopicName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated", + (input.Updated + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the TransferRepoOption type +[] +module TransferRepoOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type TransferRepoOption with + + /// Serialize to a JSON node + static member toJsonNode (input : TransferRepoOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ("new_owner", (input.NewOwner |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "team_ids", + (input.TeamIds + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the UpdateFileOptions type +[] +module UpdateFileOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type UpdateFileOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : UpdateFileOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Identity.toJsonNode field + )) + ) + + node.Add ( + "branch", + (input.Branch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Identity.toJsonNode field + )) + ) + + node.Add ("content", (input.Content |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "dates", + (input.Dates + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitDateOptions.toJsonNode field + )) + ) + + node.Add ( + "from_path", + (input.FromPath + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "new_branch", + (input.NewBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("sha", (input.Sha |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "signoff", + (input.Signoff + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the User type +[] +module UserJsonSerializeExtension = + /// Extension methods for JSON parsing + type User with + + /// Serialize to a JSON node + static member toJsonNode (input : User) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "active", + (input.Active + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "avatar_url", + (input.AvatarUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "email", + (input.Email + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "followers_count", + (input.FollowersCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "following_count", + (input.FollowingCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "is_admin", + (input.IsAdmin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "language", + (input.Language + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "last_login", + (input.LastLogin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "login", + (input.Login + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "login_name", + (input.LoginName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "prohibit_login", + (input.ProhibitLogin + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "restricted", + (input.Restricted + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "starred_repos_count", + (input.StarredReposCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "visibility", + (input.Visibility + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the UserHeatmapData type +[] +module UserHeatmapDataJsonSerializeExtension = + /// Extension methods for JSON parsing + type UserHeatmapData with + + /// Serialize to a JSON node + static member toJsonNode (input : UserHeatmapData) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "contributions", + (input.Contributions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "timestamp", + (input.Timestamp + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the UserSettings type +[] +module UserSettingsJsonSerializeExtension = + /// Extension methods for JSON parsing + type UserSettings with + + /// Serialize to a JSON node + static member toJsonNode (input : UserSettings) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "diff_view_style", + (input.DiffViewStyle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "hide_activity", + (input.HideActivity + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "hide_email", + (input.HideEmail + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "language", + (input.Language + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "theme", + (input.Theme + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the UserSettingsOptions type +[] +module UserSettingsOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type UserSettingsOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : UserSettingsOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "diff_view_style", + (input.DiffViewStyle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "hide_activity", + (input.HideActivity + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "hide_email", + (input.HideEmail + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "language", + (input.Language + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "location", + (input.Location + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "theme", + (input.Theme + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the WatchInfo type +[] +module WatchInfoJsonSerializeExtension = + /// Extension methods for JSON parsing + type WatchInfo with + + /// Serialize to a JSON node + static member toJsonNode (input : WatchInfo) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ignored", + (input.Ignored + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "reason", + (input.Reason + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun value -> System.Text.Json.Nodes.JsonObject ()) field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repository_url", + (input.RepositoryUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "subscribed", + (input.Subscribed + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the WikiCommit type +[] +module WikiCommitJsonSerializeExtension = + /// Extension methods for JSON parsing + type WikiCommit with + + /// Serialize to a JSON node + static member toJsonNode (input : WikiCommit) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "commiter", + (input.Commiter + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the WikiCommitList type +[] +module WikiCommitListJsonSerializeExtension = + /// Extension methods for JSON parsing + type WikiCommitList with + + /// Serialize to a JSON node + static member toJsonNode (input : WikiCommitList) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commits", + (input.Commits + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (WikiCommit.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "count", + (input.Count + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the WikiPage type +[] +module WikiPageJsonSerializeExtension = + /// Extension methods for JSON parsing + type WikiPage with + + /// Serialize to a JSON node + static member toJsonNode (input : WikiPage) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit_count", + (input.CommitCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "content_base64", + (input.ContentBase64 + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "footer", + (input.Footer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "last_commit", + (input.LastCommit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> WikiCommit.toJsonNode field + )) + ) + + node.Add ( + "sidebar", + (input.Sidebar + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sub_url", + (input.SubUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the WikiPageMetaData type +[] +module WikiPageMetaDataJsonSerializeExtension = + /// Extension methods for JSON parsing + type WikiPageMetaData with + + /// Serialize to a JSON node + static member toJsonNode (input : WikiPageMetaData) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "last_commit", + (input.LastCommit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> WikiCommit.toJsonNode field + )) + ) + + node.Add ( + "sub_url", + (input.SubUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Comment type +[] +module CommentJsonSerializeExtension = + /// Extension methods for JSON parsing + type Comment with + + /// Serialize to a JSON node + static member toJsonNode (input : Comment) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assets", + (input.Assets + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Attachment.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issue_url", + (input.IssueUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_author", + (input.OriginalAuthor + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_author_id", + (input.OriginalAuthorId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_request_url", + (input.PullRequestUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CommitStatus type +[] +module CommitStatusJsonSerializeExtension = + /// Extension methods for JSON parsing + type CommitStatus with + + /// Serialize to a JSON node + static member toJsonNode (input : CommitStatus) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "context", + (input.Context + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "creator", + (input.Creator + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "status", + (input.Status + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "target_url", + (input.TargetUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the ContentsResponse type +[] +module ContentsResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type ContentsResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : ContentsResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "_links", + (input.Links + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> FileLinksResponse.toJsonNode field + )) + ) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "download_url", + (input.DownloadUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "encoding", + (input.Encoding + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "git_url", + (input.GitUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "last_commit_sha", + (input.LastCommitSha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "path", + (input.Path + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "size", + (input.Size + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "submodule_git_url", + (input.SubmoduleGitUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "target", + (input.Target + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateFileOptions type +[] +module CreateFileOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateFileOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateFileOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Identity.toJsonNode field + )) + ) + + node.Add ( + "branch", + (input.Branch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Identity.toJsonNode field + )) + ) + + node.Add ("content", (input.Content |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "dates", + (input.Dates + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitDateOptions.toJsonNode field + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "new_branch", + (input.NewBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "signoff", + (input.Signoff + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreateHookOption type +[] +module CreateHookOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreateHookOption with + + /// Serialize to a JSON node + static member toJsonNode (input : CreateHookOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "active", + (input.Active + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "authorization_header", + (input.AuthorizationHeader + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "branch_filter", + (input.BranchFilter + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("config", (input.Config |> CreateHookOptionConfig.toJsonNode)) + + node.Add ( + "events", + (input.Events + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("type", (input.Type |> System.Text.Json.Nodes.JsonValue.Create)) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CreatePullReviewOptions type +[] +module CreatePullReviewOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type CreatePullReviewOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : CreatePullReviewOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "comments", + (input.Comments + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (CreatePullReviewComment.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "commit_id", + (input.CommitId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "event", + (input.Event + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the DeleteFileOptions type +[] +module DeleteFileOptionsJsonSerializeExtension = + /// Extension methods for JSON parsing + type DeleteFileOptions with + + /// Serialize to a JSON node + static member toJsonNode (input : DeleteFileOptions) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Identity.toJsonNode field + )) + ) + + node.Add ( + "branch", + (input.Branch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Identity.toJsonNode field + )) + ) + + node.Add ( + "dates", + (input.Dates + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitDateOptions.toJsonNode field + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "new_branch", + (input.NewBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ("sha", (input.Sha |> System.Text.Json.Nodes.JsonValue.Create)) + + node.Add ( + "signoff", + (input.Signoff + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the EditRepoOption type +[] +module EditRepoOptionJsonSerializeExtension = + /// Extension methods for JSON parsing + type EditRepoOption with + + /// Serialize to a JSON node + static member toJsonNode (input : EditRepoOption) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allow_manual_merge", + (input.AllowManualMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_merge_commits", + (input.AllowMergeCommits + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_rebase", + (input.AllowRebase + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_rebase_explicit", + (input.AllowRebaseExplicit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_rebase_update", + (input.AllowRebaseUpdate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_squash_merge", + (input.AllowSquashMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "archived", + (input.Archived + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "autodetect_manual_merge", + (input.AutodetectManualMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_allow_maintainer_edit", + (input.DefaultAllowMaintainerEdit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_branch", + (input.DefaultBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_delete_branch_after_merge", + (input.DefaultDeleteBranchAfterMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_merge_style", + (input.DefaultMergeStyle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_prune", + (input.EnablePrune + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "external_tracker", + (input.ExternalTracker + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> ExternalTracker.toJsonNode field + )) + ) + + node.Add ( + "external_wiki", + (input.ExternalWiki + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> ExternalWiki.toJsonNode field + )) + ) + + node.Add ( + "has_issues", + (input.HasIssues + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_projects", + (input.HasProjects + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_pull_requests", + (input.HasPullRequests + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_wiki", + (input.HasWiki + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ignore_whitespace_conflicts", + (input.IgnoreWhitespaceConflicts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "internal_tracker", + (input.InternalTracker + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> InternalTracker.toJsonNode field + )) + ) + + node.Add ( + "mirror_interval", + (input.MirrorInterval + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "private", + (input.Private + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "template", + (input.Template + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the IssueFormField type +[] +module IssueFormFieldJsonSerializeExtension = + /// Extension methods for JSON parsing + type IssueFormField with + + /// Serialize to a JSON node + static member toJsonNode (input : IssueFormField) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "attributes", + (input.Attributes + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type5.toJsonNode field + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "validations", + (input.Validations + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type6.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the IssueTemplate type +[] +module IssueTemplateJsonSerializeExtension = + /// Extension methods for JSON parsing + type IssueTemplate with + + /// Serialize to a JSON node + static member toJsonNode (input : IssueTemplate) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "about", + (input.About + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (IssueFormField.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "file_name", + (input.FileName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref", + (input.Ref + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Milestone type +[] +module MilestoneJsonSerializeExtension = + /// Extension methods for JSON parsing + type Milestone with + + /// Serialize to a JSON node + static member toJsonNode (input : Milestone) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "closed_at", + (input.ClosedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "closed_issues", + (input.ClosedIssues + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_on", + (input.DueOn + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "open_issues", + (input.OpenIssues + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NodeInfoUsage type +[] +module NodeInfoUsageJsonSerializeExtension = + /// Extension methods for JSON parsing + type NodeInfoUsage with + + /// Serialize to a JSON node + static member toJsonNode (input : NodeInfoUsage) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "localComments", + (input.LocalComments + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "localPosts", + (input.LocalPosts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "users", + (input.Users + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> NodeInfoUsageUsers.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NotificationSubject type +[] +module NotificationSubjectJsonSerializeExtension = + /// Extension methods for JSON parsing + type NotificationSubject with + + /// Serialize to a JSON node + static member toJsonNode (input : NotificationSubject) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "latest_comment_html_url", + (input.LatestCommentHtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "latest_comment_url", + (input.LatestCommentUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PayloadCommitVerification type +[] +module PayloadCommitVerificationJsonSerializeExtension = + /// Extension methods for JSON parsing + type PayloadCommitVerification with + + /// Serialize to a JSON node + static member toJsonNode (input : PayloadCommitVerification) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "payload", + (input.Payload + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "reason", + (input.Reason + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "signature", + (input.Signature + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "signer", + (input.Signer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadUser.toJsonNode field + )) + ) + + node.Add ( + "verified", + (input.Verified + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PublicKey type +[] +module PublicKeyJsonSerializeExtension = + /// Extension methods for JSON parsing + type PublicKey with + + /// Serialize to a JSON node + static member toJsonNode (input : PublicKey) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "fingerprint", + (input.Fingerprint + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "key", + (input.Key + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "key_type", + (input.KeyType + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "read_only", + (input.ReadOnly + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PullReview type +[] +module PullReviewJsonSerializeExtension = + /// Extension methods for JSON parsing + type PullReview with + + /// Serialize to a JSON node + static member toJsonNode (input : PullReview) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "comments_count", + (input.CommentsCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "commit_id", + (input.CommitId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "dismissed", + (input.Dismissed + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "official", + (input.Official + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_request_url", + (input.PullRequestUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "stale", + (input.Stale + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "submitted_at", + (input.SubmittedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "team", + (input.Team + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Team.toJsonNode field + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PullReviewComment type +[] +module PullReviewCommentJsonSerializeExtension = + /// Extension methods for JSON parsing + type PullReviewComment with + + /// Serialize to a JSON node + static member toJsonNode (input : PullReviewComment) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "commit_id", + (input.CommitId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "diff_hunk", + (input.DiffHunk + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_commit_id", + (input.OriginalCommitId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_position", + (input.OriginalPosition + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "path", + (input.Path + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "position", + (input.Position + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_request_review_id", + (input.PullRequestReviewId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_request_url", + (input.PullRequestUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "resolver", + (input.Resolver + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Reaction type +[] +module ReactionJsonSerializeExtension = + /// Extension methods for JSON parsing + type Reaction with + + /// Serialize to a JSON node + static member toJsonNode (input : Reaction) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Release type +[] +module ReleaseJsonSerializeExtension = + /// Extension methods for JSON parsing + type Release with + + /// Serialize to a JSON node + static member toJsonNode (input : Release) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assets", + (input.Assets + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Attachment.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "draft", + (input.Draft + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "prerelease", + (input.Prerelease + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "published_at", + (input.PublishedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tag_name", + (input.TagName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tarball_url", + (input.TarballUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "target_commitish", + (input.TargetCommitish + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "zipball_url", + (input.ZipballUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the RepoCollaboratorPermission type +[] +module RepoCollaboratorPermissionJsonSerializeExtension = + /// Extension methods for JSON parsing + type RepoCollaboratorPermission with + + /// Serialize to a JSON node + static member toJsonNode (input : RepoCollaboratorPermission) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "permission", + (input.Permission + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "role_name", + (input.RoleName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the RepoCommit type +[] +module RepoCommitJsonSerializeExtension = + /// Extension methods for JSON parsing + type RepoCommit with + + /// Serialize to a JSON node + static member toJsonNode (input : RepoCommit) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tree", + (input.Tree + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitMeta.toJsonNode field + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "verification", + (input.Verification + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadCommitVerification.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the RepoTransfer type +[] +module RepoTransferJsonSerializeExtension = + /// Extension methods for JSON parsing + type RepoTransfer with + + /// Serialize to a JSON node + static member toJsonNode (input : RepoTransfer) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "doer", + (input.Doer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "recipient", + (input.Recipient + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "teams", + (input.Teams + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Team.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Repository type +[] +module RepositoryJsonSerializeExtension = + /// Extension methods for JSON parsing + type Repository with + + /// Serialize to a JSON node + static member toJsonNode (input : Repository) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allow_merge_commits", + (input.AllowMergeCommits + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_rebase", + (input.AllowRebase + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_rebase_explicit", + (input.AllowRebaseExplicit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_rebase_update", + (input.AllowRebaseUpdate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "allow_squash_merge", + (input.AllowSquashMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "archived", + (input.Archived + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "avatar_url", + (input.AvatarUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "clone_url", + (input.CloneUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_allow_maintainer_edit", + (input.DefaultAllowMaintainerEdit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_branch", + (input.DefaultBranch + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_delete_branch_after_merge", + (input.DefaultDeleteBranchAfterMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "default_merge_style", + (input.DefaultMergeStyle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "description", + (input.Description + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "empty", + (input.Empty + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "external_tracker", + (input.ExternalTracker + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> ExternalTracker.toJsonNode field + )) + ) + + node.Add ( + "external_wiki", + (input.ExternalWiki + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> ExternalWiki.toJsonNode field + )) + ) + + node.Add ( + "fork", + (input.Fork + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "forks_count", + (input.ForksCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "full_name", + (input.FullName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_issues", + (input.HasIssues + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_projects", + (input.HasProjects + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_pull_requests", + (input.HasPullRequests + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "has_wiki", + (input.HasWiki + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ignore_whitespace_conflicts", + (input.IgnoreWhitespaceConflicts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "internal", + (input.Internal + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "internal_tracker", + (input.InternalTracker + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> InternalTracker.toJsonNode field + )) + ) + + node.Add ( + "language", + (input.Language + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "languages_url", + (input.LanguagesUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "link", + (input.Link + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mirror", + (input.Mirror + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mirror_interval", + (input.MirrorInterval + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mirror_updated", + (input.MirrorUpdated + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "open_issues_count", + (input.OpenIssuesCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "open_pr_counter", + (input.OpenPrCounter + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_url", + (input.OriginalUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "owner", + (input.Owner + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "parent", + (input.Parent + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Repository.toJsonNode field + )) + ) + + node.Add ( + "permissions", + (input.Permissions + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Permission.toJsonNode field + )) + ) + + node.Add ( + "private", + (input.Private + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "release_counter", + (input.ReleaseCounter + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo_transfer", + (input.RepoTransfer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> RepoTransfer.toJsonNode field + )) + ) + + node.Add ( + "size", + (input.Size + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ssh_url", + (input.SshUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "stars_count", + (input.StarsCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "template", + (input.Template + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "watchers_count", + (input.WatchersCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "website", + (input.Website + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the SearchResults type +[] +module SearchResultsJsonSerializeExtension = + /// Extension methods for JSON parsing + type SearchResults with + + /// Serialize to a JSON node + static member toJsonNode (input : SearchResults) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "data", + (input.Data + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Repository.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ok", + (input.Ok + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the AnnotatedTag type +[] +module AnnotatedTagJsonSerializeExtension = + /// Extension methods for JSON parsing + type AnnotatedTag with + + /// Serialize to a JSON node + static member toJsonNode (input : AnnotatedTag) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "object", + (input.Object + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> AnnotatedTagObject.toJsonNode field + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tag", + (input.Tag + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tagger", + (input.Tagger + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitUser.toJsonNode field + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "verification", + (input.Verification + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadCommitVerification.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the CombinedStatus type +[] +module CombinedStatusJsonSerializeExtension = + /// Extension methods for JSON parsing + type CombinedStatus with + + /// Serialize to a JSON node + static member toJsonNode (input : CombinedStatus) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit_url", + (input.CommitUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repository", + (input.Repository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Repository.toJsonNode field + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "statuses", + (input.Statuses + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (CommitStatus.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "total_count", + (input.TotalCount + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Commit type +[] +module CommitJsonSerializeExtension = + /// Extension methods for JSON parsing + type Commit with + + /// Serialize to a JSON node + static member toJsonNode (input : Commit) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "commit", + (input.Commit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> RepoCommit.toJsonNode field + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "files", + (input.Files + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (CommitAffectedFiles.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "parents", + (input.Parents + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (CommitMeta.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "stats", + (input.Stats + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> CommitStats.toJsonNode field + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the DeployKey type +[] +module DeployKeyJsonSerializeExtension = + /// Extension methods for JSON parsing + type DeployKey with + + /// Serialize to a JSON node + static member toJsonNode (input : DeployKey) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "fingerprint", + (input.Fingerprint + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "key", + (input.Key + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "key_id", + (input.KeyId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "read_only", + (input.ReadOnly + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repository", + (input.Repository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Repository.toJsonNode field + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the FileDeleteResponse type +[] +module FileDeleteResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type FileDeleteResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : FileDeleteResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit", + (input.Commit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> FileCommitResponse.toJsonNode field + )) + ) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun value -> System.Text.Json.Nodes.JsonObject ()) field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "verification", + (input.Verification + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadCommitVerification.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the FileResponse type +[] +module FileResponseJsonSerializeExtension = + /// Extension methods for JSON parsing + type FileResponse with + + /// Serialize to a JSON node + static member toJsonNode (input : FileResponse) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit", + (input.Commit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> FileCommitResponse.toJsonNode field + )) + ) + + node.Add ( + "content", + (input.Content + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> ContentsResponse.toJsonNode field + )) + ) + + node.Add ( + "verification", + (input.Verification + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadCommitVerification.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Issue type +[] +module IssueJsonSerializeExtension = + /// Extension methods for JSON parsing + type Issue with + + /// Serialize to a JSON node + static member toJsonNode (input : Issue) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assets", + (input.Assets + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Attachment.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "assignees", + (input.Assignees + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (User.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "closed_at", + (input.ClosedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "comments", + (input.Comments + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "is_locked", + (input.IsLocked + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Label.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Milestone.toJsonNode field + )) + ) + + node.Add ( + "number", + (input.Number + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_author", + (input.OriginalAuthor + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "original_author_id", + (input.OriginalAuthorId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_request", + (input.PullRequest + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PullRequestMeta.toJsonNode field + )) + ) + + node.Add ( + "ref", + (input.Ref + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repository", + (input.Repository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> RepositoryMeta.toJsonNode field + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NodeInfo type +[] +module NodeInfoJsonSerializeExtension = + /// Extension methods for JSON parsing + type NodeInfo with + + /// Serialize to a JSON node + static member toJsonNode (input : NodeInfo) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "metadata", + (input.Metadata + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Type7.toJsonNode field + )) + ) + + node.Add ( + "openRegistrations", + (input.OpenRegistrations + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "protocols", + (input.Protocols + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "services", + (input.Services + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> NodeInfoServices.toJsonNode field + )) + ) + + node.Add ( + "software", + (input.Software + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> NodeInfoSoftware.toJsonNode field + )) + ) + + node.Add ( + "usage", + (input.Usage + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> NodeInfoUsage.toJsonNode field + )) + ) + + node.Add ( + "version", + (input.Version + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Note type +[] +module NoteJsonSerializeExtension = + /// Extension methods for JSON parsing + type Note with + + /// Serialize to a JSON node + static member toJsonNode (input : Note) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit", + (input.Commit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Commit.toJsonNode field + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the NotificationThread type +[] +module NotificationThreadJsonSerializeExtension = + /// Extension methods for JSON parsing + type NotificationThread with + + /// Serialize to a JSON node + static member toJsonNode (input : NotificationThread) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pinned", + (input.Pinned + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repository", + (input.Repository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Repository.toJsonNode field + )) + ) + + node.Add ( + "subject", + (input.Subject + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> NotificationSubject.toJsonNode field + )) + ) + + node.Add ( + "unread", + (input.Unread + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PRBranchInfo type +[] +module PRBranchInfoJsonSerializeExtension = + /// Extension methods for JSON parsing + type PRBranchInfo with + + /// Serialize to a JSON node + static member toJsonNode (input : PRBranchInfo) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "label", + (input.Label + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref", + (input.Ref + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "repo", + (input.Repo + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Repository.toJsonNode field + )) + ) + + node.Add ( + "repo_id", + (input.RepoId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "sha", + (input.Sha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Package type +[] +module PackageJsonSerializeExtension = + /// Extension methods for JSON parsing + type Package with + + /// Serialize to a JSON node + static member toJsonNode (input : Package) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "creator", + (input.Creator + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "owner", + (input.Owner + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "repository", + (input.Repository + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Repository.toJsonNode field + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "version", + (input.Version + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PayloadCommit type +[] +module PayloadCommitJsonSerializeExtension = + /// Extension methods for JSON parsing + type PayloadCommit with + + /// Serialize to a JSON node + static member toJsonNode (input : PayloadCommit) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "added", + (input.Added + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "author", + (input.Author + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadUser.toJsonNode field + )) + ) + + node.Add ( + "committer", + (input.Committer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadUser.toJsonNode field + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "message", + (input.Message + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "modified", + (input.Modified + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "removed", + (input.Removed + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "timestamp", + (input.Timestamp + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "verification", + (input.Verification + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadCommitVerification.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the PullRequest type +[] +module PullRequestJsonSerializeExtension = + /// Extension methods for JSON parsing + type PullRequest with + + /// Serialize to a JSON node + static member toJsonNode (input : PullRequest) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "allow_maintainer_edit", + (input.AllowMaintainerEdit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "assignees", + (input.Assignees + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (User.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "base", + (input.Base + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PRBranchInfo.toJsonNode field + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "closed_at", + (input.ClosedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "comments", + (input.Comments + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "diff_url", + (input.DiffUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "due_date", + (input.DueDate + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "head", + (input.Head + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PRBranchInfo.toJsonNode field + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "is_locked", + (input.IsLocked + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "labels", + (input.Labels + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (Label.toJsonNode mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_base", + (input.MergeBase + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merge_commit_sha", + (input.MergeCommitSha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "mergeable", + (input.Mergeable + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merged", + (input.Merged + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merged_at", + (input.MergedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "merged_by", + (input.MergedBy + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Milestone.toJsonNode field + )) + ) + + node.Add ( + "number", + (input.Number + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "patch_url", + (input.PatchUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "state", + (input.State + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "title", + (input.Title + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "url", + (input.Url + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the TrackedTime type +[] +module TrackedTimeJsonSerializeExtension = + /// Extension methods for JSON parsing + type TrackedTime with + + /// Serialize to a JSON node + static member toJsonNode (input : TrackedTime) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "created", + (input.Created + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issue", + (input.Issue + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Issue.toJsonNode field + )) + ) + + node.Add ( + "issue_id", + (input.IssueId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "time", + (input.Time + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user_id", + (input.UserId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user_name", + (input.UserName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the Branch type +[] +module BranchJsonSerializeExtension = + /// Extension methods for JSON parsing + type Branch with + + /// Serialize to a JSON node + static member toJsonNode (input : Branch) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "commit", + (input.Commit + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> PayloadCommit.toJsonNode field + )) + ) + + node.Add ( + "effective_branch_protection_name", + (input.EffectiveBranchProtectionName + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "enable_status_check", + (input.EnableStatusCheck + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "name", + (input.Name + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "protected", + (input.Protected + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "required_approvals", + (input.RequiredApprovals + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "status_check_contexts", + (input.StatusCheckContexts + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + ((fun field -> + let arr = System.Text.Json.Nodes.JsonArray () + + for mem in field do + arr.Add (System.Text.Json.Nodes.JsonValue.Create mem) + + arr + ) + field) + :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user_can_merge", + (input.UserCanMerge + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user_can_push", + (input.UserCanPush + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the TimelineComment type +[] +module TimelineCommentJsonSerializeExtension = + /// Extension methods for JSON parsing + type TimelineComment with + + /// Serialize to a JSON node + static member toJsonNode (input : TimelineComment) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, id value) + + node.Add ( + "assignee", + (input.Assignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "assignee_team", + (input.AssigneeTeam + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Team.toJsonNode field + )) + ) + + node.Add ( + "body", + (input.Body + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "created_at", + (input.CreatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "dependent_issue", + (input.DependentIssue + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Issue.toJsonNode field + )) + ) + + node.Add ( + "html_url", + (input.HtmlUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "id", + (input.Id + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "issue_url", + (input.IssueUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "label", + (input.Label + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Label.toJsonNode field + )) + ) + + node.Add ( + "milestone", + (input.Milestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Milestone.toJsonNode field + )) + ) + + node.Add ( + "new_ref", + (input.NewRef + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "new_title", + (input.NewTitle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "old_milestone", + (input.OldMilestone + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Milestone.toJsonNode field + )) + ) + + node.Add ( + "old_project_id", + (input.OldProjectId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "old_ref", + (input.OldRef + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "old_title", + (input.OldTitle + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "project_id", + (input.ProjectId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "pull_request_url", + (input.PullRequestUrl + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref_action", + (input.RefAction + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref_comment", + (input.RefComment + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Comment.toJsonNode field + )) + ) + + node.Add ( + "ref_commit_sha", + (input.RefCommitSha + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "ref_issue", + (input.RefIssue + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> Issue.toJsonNode field + )) + ) + + node.Add ( + "removed_assignee", + (input.RemovedAssignee + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "resolve_doer", + (input.ResolveDoer + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node.Add ( + "review_id", + (input.ReviewId + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "tracked_time", + (input.TrackedTime + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> TrackedTime.toJsonNode field + )) + ) + + node.Add ( + "type", + (input.Type + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "updated_at", + (input.UpdatedAt + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> + (System.Text.Json.Nodes.JsonValue.Create field) :> System.Text.Json.Nodes.JsonNode + )) + ) + + node.Add ( + "user", + (input.User + |> (fun field -> + match field with + | None -> null :> System.Text.Json.Nodes.JsonNode + | Some field -> User.toJsonNode field + )) + ) + + node :> _ +namespace Gitea + +open WoofWare.Whippet.Plugin.Json +open WoofWare.Whippet.Plugin.HttpClient + +/// Module containing JSON serializing extension members for the LanguageStatistics type +[] +module LanguageStatisticsJsonSerializeExtension = + /// Extension methods for JSON parsing + type LanguageStatistics with + + /// Serialize to a JSON node + static member toJsonNode (input : LanguageStatistics) : System.Text.Json.Nodes.JsonNode = + let node = System.Text.Json.Nodes.JsonObject () + + do + for KeyValue (key, value) in input.AdditionalProperties do + node.Add (key, System.Text.Json.Nodes.JsonValue.Create value) + + node :> _ + +namespace Gitea + +/// Module containing JSON parsing extension members for the APIError type +[] +module APIErrorJsonParseExtension = + /// Extension methods for JSON parsing + type APIError with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : APIError = + let arg_2 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "message" || key = "url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Message = arg_1 + Url = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the AccessToken type +[] +module AccessTokenJsonParseExtension = + /// Extension methods for JSON parsing + type AccessToken with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : AccessToken = + let arg_5 = + match node.["token_last_eight"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["sha1"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["scopes"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_2 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "id" + || key = "name" + || key = "scopes" + || key = "sha1" + || key = "token_last_eight" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Id = arg_1 + Name = arg_2 + Scopes = arg_3 + Sha1 = arg_4 + TokenLastEight = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the ActivityPub type +[] +module ActivityPubJsonParseExtension = + /// Extension methods for JSON parsing + type ActivityPub with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ActivityPub = + let arg_1 = + match node.["@context"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "@context" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Context = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the AddCollaboratorOption type +[] +module AddCollaboratorOptionJsonParseExtension = + /// Extension methods for JSON parsing + type AddCollaboratorOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : AddCollaboratorOption = + let arg_1 = + match node.["permission"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "permission" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Permission = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the AddTimeOption type +[] +module AddTimeOptionJsonParseExtension = + /// Extension methods for JSON parsing + type AddTimeOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : AddTimeOption = + let arg_3 = + match node.["user_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + (match node.["time"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("time") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_1 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "created" || key = "time" || key = "user_name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Created = arg_1 + Time = arg_2 + UserName = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the AnnotatedTagObject type +[] +module AnnotatedTagObjectJsonParseExtension = + /// Extension methods for JSON parsing + type AnnotatedTagObject with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : AnnotatedTagObject = + let arg_3 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "sha" || key = "type" || key = "url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Sha = arg_1 + Type = arg_2 + Url = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Attachment type +[] +module AttachmentJsonParseExtension = + /// Extension methods for JSON parsing + type Attachment with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Attachment = + let arg_7 = + match node.["uuid"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["download_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["browser_download_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "browser_download_url" + || key = "created_at" + || key = "download_count" + || key = "id" + || key = "name" + || key = "size" + || key = "uuid" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + BrowserDownloadUrl = arg_1 + CreatedAt = arg_2 + DownloadCount = arg_3 + Id = arg_4 + Name = arg_5 + Size = arg_6 + Uuid = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the BranchProtection type +[] +module BranchProtectionJsonParseExtension = + /// Extension methods for JSON parsing + type BranchProtection with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : BranchProtection = + let arg_25 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_24 = + match node.["unprotected_file_patterns"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_23 = + match node.["status_check_contexts"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_22 = + match node.["rule_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_21 = + match node.["required_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["require_signed_commits"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["push_whitelist_usernames"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_18 = + match node.["push_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_17 = + match node.["push_whitelist_deploy_keys"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + match node.["protected_file_patterns"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_15 = + match node.["merge_whitelist_usernames"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_14 = + match node.["merge_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_13 = + match node.["enable_status_check"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["enable_push_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["enable_push"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["enable_merge_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["enable_approvals_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["dismiss_stale_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["branch_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["block_on_rejected_reviews"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["block_on_outdated_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["block_on_official_review_requests"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["approvals_whitelist_username"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["approvals_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "approvals_whitelist_teams" + || key = "approvals_whitelist_username" + || key = "block_on_official_review_requests" + || key = "block_on_outdated_branch" + || key = "block_on_rejected_reviews" + || key = "branch_name" + || key = "created_at" + || key = "dismiss_stale_approvals" + || key = "enable_approvals_whitelist" + || key = "enable_merge_whitelist" + || key = "enable_push" + || key = "enable_push_whitelist" + || key = "enable_status_check" + || key = "merge_whitelist_teams" + || key = "merge_whitelist_usernames" + || key = "protected_file_patterns" + || key = "push_whitelist_deploy_keys" + || key = "push_whitelist_teams" + || key = "push_whitelist_usernames" + || key = "require_signed_commits" + || key = "required_approvals" + || key = "rule_name" + || key = "status_check_contexts" + || key = "unprotected_file_patterns" + || key = "updated_at" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ApprovalsWhitelistTeams = arg_1 + ApprovalsWhitelistUsername = arg_2 + BlockOnOfficialReviewRequests = arg_3 + BlockOnOutdatedBranch = arg_4 + BlockOnRejectedReviews = arg_5 + BranchName = arg_6 + CreatedAt = arg_7 + DismissStaleApprovals = arg_8 + EnableApprovalsWhitelist = arg_9 + EnableMergeWhitelist = arg_10 + EnablePush = arg_11 + EnablePushWhitelist = arg_12 + EnableStatusCheck = arg_13 + MergeWhitelistTeams = arg_14 + MergeWhitelistUsernames = arg_15 + ProtectedFilePatterns = arg_16 + PushWhitelistDeployKeys = arg_17 + PushWhitelistTeams = arg_18 + PushWhitelistUsernames = arg_19 + RequireSignedCommits = arg_20 + RequiredApprovals = arg_21 + RuleName = arg_22 + StatusCheckContexts = arg_23 + UnprotectedFilePatterns = arg_24 + UpdatedAt = arg_25 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the ChangedFile type +[] +module ChangedFileJsonParseExtension = + /// Extension methods for JSON parsing + type ChangedFile with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ChangedFile = + let arg_9 = + match node.["status"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["raw_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["previous_filename"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["filename"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["deletions"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["contents_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["changes"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["additions"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "additions" + || key = "changes" + || key = "contents_url" + || key = "deletions" + || key = "filename" + || key = "html_url" + || key = "previous_filename" + || key = "raw_url" + || key = "status" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Additions = arg_1 + Changes = arg_2 + ContentsUrl = arg_3 + Deletions = arg_4 + Filename = arg_5 + HtmlUrl = arg_6 + PreviousFilename = arg_7 + RawUrl = arg_8 + Status = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CommitAffectedFiles type +[] +module CommitAffectedFilesJsonParseExtension = + /// Extension methods for JSON parsing + type CommitAffectedFiles with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CommitAffectedFiles = + let arg_1 = + match node.["filename"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "filename" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Filename = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CommitDateOptions type +[] +module CommitDateOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type CommitDateOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CommitDateOptions = + let arg_2 = + match node.["committer"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "author" || key = "committer" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Committer = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CommitMeta type +[] +module CommitMetaJsonParseExtension = + /// Extension methods for JSON parsing + type CommitMeta with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CommitMeta = + let arg_3 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "created" || key = "sha" || key = "url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Created = arg_1 + Sha = arg_2 + Url = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CommitStats type +[] +module CommitStatsJsonParseExtension = + /// Extension methods for JSON parsing + type CommitStats with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CommitStats = + let arg_3 = + match node.["total"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["deletions"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["additions"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "additions" || key = "deletions" || key = "total" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Additions = arg_1 + Deletions = arg_2 + Total = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CommitUser type +[] +module CommitUserJsonParseExtension = + /// Extension methods for JSON parsing + type CommitUser with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CommitUser = + let arg_3 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "date" || key = "email" || key = "name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Date = arg_1 + Email = arg_2 + Name = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateAccessTokenOption type +[] +module CreateAccessTokenOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateAccessTokenOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateAccessTokenOption = + let arg_2 = + match node.["scopes"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + (match node.["name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "name" || key = "scopes" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Name = arg_1 + Scopes = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateBranchProtectionOption type +[] +module CreateBranchProtectionOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateBranchProtectionOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateBranchProtectionOption = + let arg_23 = + match node.["unprotected_file_patterns"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_22 = + match node.["status_check_contexts"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_21 = + match node.["rule_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["required_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["require_signed_commits"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["push_whitelist_usernames"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_17 = + match node.["push_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_16 = + match node.["push_whitelist_deploy_keys"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_15 = + match node.["protected_file_patterns"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["merge_whitelist_usernames"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_13 = + match node.["merge_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_12 = + match node.["enable_status_check"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["enable_push_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["enable_push"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["enable_merge_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["enable_approvals_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["dismiss_stale_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["branch_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["block_on_rejected_reviews"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["block_on_outdated_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["block_on_official_review_requests"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["approvals_whitelist_username"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["approvals_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "approvals_whitelist_teams" + || key = "approvals_whitelist_username" + || key = "block_on_official_review_requests" + || key = "block_on_outdated_branch" + || key = "block_on_rejected_reviews" + || key = "branch_name" + || key = "dismiss_stale_approvals" + || key = "enable_approvals_whitelist" + || key = "enable_merge_whitelist" + || key = "enable_push" + || key = "enable_push_whitelist" + || key = "enable_status_check" + || key = "merge_whitelist_teams" + || key = "merge_whitelist_usernames" + || key = "protected_file_patterns" + || key = "push_whitelist_deploy_keys" + || key = "push_whitelist_teams" + || key = "push_whitelist_usernames" + || key = "require_signed_commits" + || key = "required_approvals" + || key = "rule_name" + || key = "status_check_contexts" + || key = "unprotected_file_patterns" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ApprovalsWhitelistTeams = arg_1 + ApprovalsWhitelistUsername = arg_2 + BlockOnOfficialReviewRequests = arg_3 + BlockOnOutdatedBranch = arg_4 + BlockOnRejectedReviews = arg_5 + BranchName = arg_6 + DismissStaleApprovals = arg_7 + EnableApprovalsWhitelist = arg_8 + EnableMergeWhitelist = arg_9 + EnablePush = arg_10 + EnablePushWhitelist = arg_11 + EnableStatusCheck = arg_12 + MergeWhitelistTeams = arg_13 + MergeWhitelistUsernames = arg_14 + ProtectedFilePatterns = arg_15 + PushWhitelistDeployKeys = arg_16 + PushWhitelistTeams = arg_17 + PushWhitelistUsernames = arg_18 + RequireSignedCommits = arg_19 + RequiredApprovals = arg_20 + RuleName = arg_21 + StatusCheckContexts = arg_22 + UnprotectedFilePatterns = arg_23 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateBranchRepoOption type +[] +module CreateBranchRepoOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateBranchRepoOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateBranchRepoOption = + let arg_2 = + match node.["old_branch_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + (match node.["new_branch_name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("new_branch_name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "new_branch_name" || key = "old_branch_name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + NewBranchName = arg_1 + OldBranchName = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateEmailOption type +[] +module CreateEmailOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateEmailOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateEmailOption = + let arg_1 = + match node.["emails"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "emails" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Emails = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateForkOption type +[] +module CreateForkOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateForkOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateForkOption = + let arg_2 = + match node.["organization"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "name" || key = "organization" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Name = arg_1 + Organization = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateGPGKeyOption type +[] +module CreateGPGKeyOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateGPGKeyOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateGPGKeyOption = + let arg_2 = + match node.["armored_signature"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + (match node.["armored_public_key"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("armored_public_key") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "armored_public_key" || key = "armored_signature" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ArmoredPublicKey = arg_1 + ArmoredSignature = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateHookOptionConfig type +[] +module CreateHookOptionConfigJsonParseExtension = + /// Extension methods for JSON parsing + type CreateHookOptionConfig with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateHookOptionConfig = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateIssueCommentOption type +[] +module CreateIssueCommentOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateIssueCommentOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateIssueCommentOption = + let arg_1 = + (match node.["body"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("body") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "body" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateIssueOption type +[] +module CreateIssueOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateIssueOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateIssueOption = + let arg_9 = + (match node.["title"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("title") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_8 = + match node.["ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["milestone"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["labels"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_5 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["closed"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["assignees"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["assignee"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assignee" + || key = "assignees" + || key = "body" + || key = "closed" + || key = "due_date" + || key = "labels" + || key = "milestone" + || key = "ref" + || key = "title" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assignee = arg_1 + Assignees = arg_2 + Body = arg_3 + Closed = arg_4 + DueDate = arg_5 + Labels = arg_6 + Milestone = arg_7 + Ref = arg_8 + Title = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateKeyOption type +[] +module CreateKeyOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateKeyOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateKeyOption = + let arg_3 = + (match node.["title"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("title") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_2 = + match node.["read_only"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + (match node.["key"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("key") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "key" || key = "read_only" || key = "title" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Key = arg_1 + ReadOnly = arg_2 + Title = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateLabelOption type +[] +module CreateLabelOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateLabelOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateLabelOption = + let arg_4 = + (match node.["name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_3 = + match node.["exclusive"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + (match node.["color"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("color") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "color" || key = "description" || key = "exclusive" || key = "name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Color = arg_1 + Description = arg_2 + Exclusive = arg_3 + Name = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateMilestoneOption type +[] +module CreateMilestoneOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateMilestoneOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateMilestoneOption = + let arg_4 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["due_on"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "description" || key = "due_on" || key = "state" || key = "title" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Description = arg_1 + DueOn = arg_2 + State = arg_3 + Title = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateOAuth2ApplicationOptions type +[] +module CreateOAuth2ApplicationOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type CreateOAuth2ApplicationOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateOAuth2ApplicationOptions = + let arg_3 = + match node.["redirect_uris"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_2 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["confidential_client"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "confidential_client" || key = "name" || key = "redirect_uris" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ConfidentialClient = arg_1 + Name = arg_2 + RedirectUris = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateOrgOption type +[] +module CreateOrgOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateOrgOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateOrgOption = + let arg_7 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["visibility"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + (match node.["username"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("username") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_4 = + match node.["repo_admin_change_team_access"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "description" + || key = "full_name" + || key = "location" + || key = "repo_admin_change_team_access" + || key = "username" + || key = "visibility" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Description = arg_1 + FullName = arg_2 + Location = arg_3 + RepoAdminChangeTeamAccess = arg_4 + Username = arg_5 + Visibility = arg_6 + Website = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreatePullRequestOption type +[] +module CreatePullRequestOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreatePullRequestOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreatePullRequestOption = + let arg_9 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["milestone"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["labels"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_6 = + match node.["head"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["base"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["assignees"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["assignee"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assignee" + || key = "assignees" + || key = "base" + || key = "body" + || key = "due_date" + || key = "head" + || key = "labels" + || key = "milestone" + || key = "title" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assignee = arg_1 + Assignees = arg_2 + Base = arg_3 + Body = arg_4 + DueDate = arg_5 + Head = arg_6 + Labels = arg_7 + Milestone = arg_8 + Title = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreatePullReviewComment type +[] +module CreatePullReviewCommentJsonParseExtension = + /// Extension methods for JSON parsing + type CreatePullReviewComment with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreatePullReviewComment = + let arg_4 = + match node.["path"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["old_position"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["new_position"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "body" || key = "new_position" || key = "old_position" || key = "path" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + NewPosition = arg_2 + OldPosition = arg_3 + Path = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreatePushMirrorOption type +[] +module CreatePushMirrorOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreatePushMirrorOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreatePushMirrorOption = + let arg_5 = + match node.["sync_on_commit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["remote_username"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["remote_password"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["remote_address"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["interval"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "interval" + || key = "remote_address" + || key = "remote_password" + || key = "remote_username" + || key = "sync_on_commit" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Interval = arg_1 + RemoteAddress = arg_2 + RemotePassword = arg_3 + RemoteUsername = arg_4 + SyncOnCommit = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateReleaseOption type +[] +module CreateReleaseOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateReleaseOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateReleaseOption = + let arg_6 = + match node.["target_commitish"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + (match node.["tag_name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("tag_name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_4 = + match node.["prerelease"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["draft"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "body" + || key = "draft" + || key = "name" + || key = "prerelease" + || key = "tag_name" + || key = "target_commitish" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + Draft = arg_2 + Name = arg_3 + Prerelease = arg_4 + TagName = arg_5 + TargetCommitish = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateRepoOption type +[] +module CreateRepoOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateRepoOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateRepoOption = + let arg_11 = + match node.["trust_model"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["template"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["readme"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["private"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + (match node.["name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_6 = + match node.["license"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["issue_labels"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["gitignores"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["default_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["auto_init"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "auto_init" + || key = "default_branch" + || key = "description" + || key = "gitignores" + || key = "issue_labels" + || key = "license" + || key = "name" + || key = "private" + || key = "readme" + || key = "template" + || key = "trust_model" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AutoInit = arg_1 + DefaultBranch = arg_2 + Description = arg_3 + Gitignores = arg_4 + IssueLabels = arg_5 + License = arg_6 + Name = arg_7 + Private = arg_8 + Readme = arg_9 + Template = arg_10 + TrustModel = arg_11 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateStatusOption type +[] +module CreateStatusOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateStatusOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateStatusOption = + let arg_4 = + match node.["target_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["context"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "context" || key = "description" || key = "state" || key = "target_url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Context = arg_1 + Description = arg_2 + State = arg_3 + TargetUrl = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateTagOption type +[] +module CreateTagOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateTagOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateTagOption = + let arg_3 = + match node.["target"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + (match node.["tag_name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("tag_name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_1 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "message" || key = "tag_name" || key = "target" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Message = arg_1 + TagName = arg_2 + Target = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type1 type +[] +module Type1JsonParseExtension = + /// Extension methods for JSON parsing + type Type1 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type1 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateTeamOption type +[] +module CreateTeamOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateTeamOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateTeamOption = + let arg_7 = + match node.["units_map"] with + | null -> None + | v -> Type1.jsonParse v |> Some + + let arg_6 = + match node.["units"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_5 = + match node.["permission"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + (match node.["name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_3 = + match node.["includes_all_repositories"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["can_create_org_repo"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "can_create_org_repo" + || key = "description" + || key = "includes_all_repositories" + || key = "name" + || key = "permission" + || key = "units" + || key = "units_map" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CanCreateOrgRepo = arg_1 + Description = arg_2 + IncludesAllRepositories = arg_3 + Name = arg_4 + Permission = arg_5 + Units = arg_6 + UnitsMap = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateUserOption type +[] +module CreateUserOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateUserOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateUserOption = + let arg_11 = + match node.["visibility"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + (match node.["username"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("username") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_9 = + match node.["source_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["send_notify"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["restricted"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + (match node.["password"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("password") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_5 = + match node.["must_change_password"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["login_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + (match node.["email"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("email") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_1 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created_at" + || key = "email" + || key = "full_name" + || key = "login_name" + || key = "must_change_password" + || key = "password" + || key = "restricted" + || key = "send_notify" + || key = "source_id" + || key = "username" + || key = "visibility" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CreatedAt = arg_1 + Email = arg_2 + FullName = arg_3 + LoginName = arg_4 + MustChangePassword = arg_5 + Password = arg_6 + Restricted = arg_7 + SendNotify = arg_8 + SourceId = arg_9 + Username = arg_10 + Visibility = arg_11 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateWikiPageOptions type +[] +module CreateWikiPageOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type CreateWikiPageOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateWikiPageOptions = + let arg_3 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["content_base64"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "content_base64" || key = "message" || key = "title" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ContentBase64 = arg_1 + Message = arg_2 + Title = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Cron type +[] +module CronJsonParseExtension = + /// Extension methods for JSON parsing + type Cron with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Cron = + let arg_5 = + match node.["schedule"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["prev"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["next"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["exec_times"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "exec_times" + || key = "name" + || key = "next" + || key = "prev" + || key = "schedule" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ExecTimes = arg_1 + Name = arg_2 + Next = arg_3 + Prev = arg_4 + Schedule = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the DeleteEmailOption type +[] +module DeleteEmailOptionJsonParseExtension = + /// Extension methods for JSON parsing + type DeleteEmailOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : DeleteEmailOption = + let arg_1 = + match node.["emails"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "emails" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Emails = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the DismissPullReviewOptions type +[] +module DismissPullReviewOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type DismissPullReviewOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : DismissPullReviewOptions = + let arg_2 = + match node.["priors"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "message" || key = "priors" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Message = arg_1 + Priors = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditAttachmentOptions type +[] +module EditAttachmentOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type EditAttachmentOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditAttachmentOptions = + let arg_1 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "name" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Name = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditBranchProtectionOption type +[] +module EditBranchProtectionOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditBranchProtectionOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditBranchProtectionOption = + let arg_21 = + match node.["unprotected_file_patterns"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["status_check_contexts"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_19 = + match node.["required_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["require_signed_commits"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["push_whitelist_usernames"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_16 = + match node.["push_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_15 = + match node.["push_whitelist_deploy_keys"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["protected_file_patterns"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["merge_whitelist_usernames"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_12 = + match node.["merge_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_11 = + match node.["enable_status_check"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["enable_push_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["enable_push"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["enable_merge_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["enable_approvals_whitelist"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["dismiss_stale_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["block_on_rejected_reviews"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["block_on_outdated_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["block_on_official_review_requests"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["approvals_whitelist_username"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["approvals_whitelist_teams"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "approvals_whitelist_teams" + || key = "approvals_whitelist_username" + || key = "block_on_official_review_requests" + || key = "block_on_outdated_branch" + || key = "block_on_rejected_reviews" + || key = "dismiss_stale_approvals" + || key = "enable_approvals_whitelist" + || key = "enable_merge_whitelist" + || key = "enable_push" + || key = "enable_push_whitelist" + || key = "enable_status_check" + || key = "merge_whitelist_teams" + || key = "merge_whitelist_usernames" + || key = "protected_file_patterns" + || key = "push_whitelist_deploy_keys" + || key = "push_whitelist_teams" + || key = "push_whitelist_usernames" + || key = "require_signed_commits" + || key = "required_approvals" + || key = "status_check_contexts" + || key = "unprotected_file_patterns" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ApprovalsWhitelistTeams = arg_1 + ApprovalsWhitelistUsername = arg_2 + BlockOnOfficialReviewRequests = arg_3 + BlockOnOutdatedBranch = arg_4 + BlockOnRejectedReviews = arg_5 + DismissStaleApprovals = arg_6 + EnableApprovalsWhitelist = arg_7 + EnableMergeWhitelist = arg_8 + EnablePush = arg_9 + EnablePushWhitelist = arg_10 + EnableStatusCheck = arg_11 + MergeWhitelistTeams = arg_12 + MergeWhitelistUsernames = arg_13 + ProtectedFilePatterns = arg_14 + PushWhitelistDeployKeys = arg_15 + PushWhitelistTeams = arg_16 + PushWhitelistUsernames = arg_17 + RequireSignedCommits = arg_18 + RequiredApprovals = arg_19 + StatusCheckContexts = arg_20 + UnprotectedFilePatterns = arg_21 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditDeadlineOption type +[] +module EditDeadlineOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditDeadlineOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditDeadlineOption = + let arg_1 = + (match node.["due_date"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("due_date") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "due_date" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + DueDate = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditGitHookOption type +[] +module EditGitHookOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditGitHookOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditGitHookOption = + let arg_1 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "content" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Content = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type2 type +[] +module Type2JsonParseExtension = + /// Extension methods for JSON parsing + type Type2 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type2 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditHookOption type +[] +module EditHookOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditHookOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditHookOption = + let arg_5 = + match node.["events"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_4 = + match node.["config"] with + | null -> None + | v -> Type2.jsonParse v |> Some + + let arg_3 = + match node.["branch_filter"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["authorization_header"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["active"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "active" + || key = "authorization_header" + || key = "branch_filter" + || key = "config" + || key = "events" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Active = arg_1 + AuthorizationHeader = arg_2 + BranchFilter = arg_3 + Config = arg_4 + Events = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditIssueCommentOption type +[] +module EditIssueCommentOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditIssueCommentOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditIssueCommentOption = + let arg_1 = + (match node.["body"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("body") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "body" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditIssueOption type +[] +module EditIssueOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditIssueOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditIssueOption = + let arg_9 = + match node.["unset_due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["milestone"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["assignees"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["assignee"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assignee" + || key = "assignees" + || key = "body" + || key = "due_date" + || key = "milestone" + || key = "ref" + || key = "state" + || key = "title" + || key = "unset_due_date" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assignee = arg_1 + Assignees = arg_2 + Body = arg_3 + DueDate = arg_4 + Milestone = arg_5 + Ref = arg_6 + State = arg_7 + Title = arg_8 + UnsetDueDate = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditLabelOption type +[] +module EditLabelOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditLabelOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditLabelOption = + let arg_4 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["exclusive"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["color"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "color" || key = "description" || key = "exclusive" || key = "name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Color = arg_1 + Description = arg_2 + Exclusive = arg_3 + Name = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditMilestoneOption type +[] +module EditMilestoneOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditMilestoneOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditMilestoneOption = + let arg_4 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["due_on"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "description" || key = "due_on" || key = "state" || key = "title" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Description = arg_1 + DueOn = arg_2 + State = arg_3 + Title = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditOrgOption type +[] +module EditOrgOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditOrgOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditOrgOption = + let arg_6 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["visibility"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["repo_admin_change_team_access"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "description" + || key = "full_name" + || key = "location" + || key = "repo_admin_change_team_access" + || key = "visibility" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Description = arg_1 + FullName = arg_2 + Location = arg_3 + RepoAdminChangeTeamAccess = arg_4 + Visibility = arg_5 + Website = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditPullRequestOption type +[] +module EditPullRequestOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditPullRequestOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditPullRequestOption = + let arg_11 = + match node.["unset_due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["milestone"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["labels"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_6 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["base"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["assignees"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_2 = + match node.["assignee"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["allow_maintainer_edit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "allow_maintainer_edit" + || key = "assignee" + || key = "assignees" + || key = "base" + || key = "body" + || key = "due_date" + || key = "labels" + || key = "milestone" + || key = "state" + || key = "title" + || key = "unset_due_date" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowMaintainerEdit = arg_1 + Assignee = arg_2 + Assignees = arg_3 + Base = arg_4 + Body = arg_5 + DueDate = arg_6 + Labels = arg_7 + Milestone = arg_8 + State = arg_9 + Title = arg_10 + UnsetDueDate = arg_11 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditReactionOption type +[] +module EditReactionOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditReactionOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditReactionOption = + let arg_1 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "content" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Content = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditReleaseOption type +[] +module EditReleaseOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditReleaseOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditReleaseOption = + let arg_6 = + match node.["target_commitish"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["tag_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["prerelease"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["draft"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "body" + || key = "draft" + || key = "name" + || key = "prerelease" + || key = "tag_name" + || key = "target_commitish" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + Draft = arg_2 + Name = arg_3 + Prerelease = arg_4 + TagName = arg_5 + TargetCommitish = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type3 type +[] +module Type3JsonParseExtension = + /// Extension methods for JSON parsing + type Type3 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type3 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditTeamOption type +[] +module EditTeamOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditTeamOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditTeamOption = + let arg_7 = + match node.["units_map"] with + | null -> None + | v -> Type3.jsonParse v |> Some + + let arg_6 = + match node.["units"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_5 = + match node.["permission"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + (match node.["name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_3 = + match node.["includes_all_repositories"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["can_create_org_repo"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "can_create_org_repo" + || key = "description" + || key = "includes_all_repositories" + || key = "name" + || key = "permission" + || key = "units" + || key = "units_map" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CanCreateOrgRepo = arg_1 + Description = arg_2 + IncludesAllRepositories = arg_3 + Name = arg_4 + Permission = arg_5 + Units = arg_6 + UnitsMap = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditUserOption type +[] +module EditUserOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditUserOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditUserOption = + let arg_18 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["visibility"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + (match node.["source_id"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("source_id") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_15 = + match node.["restricted"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["prohibit_login"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["password"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["must_change_password"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["max_repo_creation"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + (match node.["login_name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("login_name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_9 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["allow_import_local"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["allow_git_hook"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["allow_create_organization"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["admin"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["active"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "active" + || key = "admin" + || key = "allow_create_organization" + || key = "allow_git_hook" + || key = "allow_import_local" + || key = "description" + || key = "email" + || key = "full_name" + || key = "location" + || key = "login_name" + || key = "max_repo_creation" + || key = "must_change_password" + || key = "password" + || key = "prohibit_login" + || key = "restricted" + || key = "source_id" + || key = "visibility" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Active = arg_1 + Admin = arg_2 + AllowCreateOrganization = arg_3 + AllowGitHook = arg_4 + AllowImportLocal = arg_5 + Description = arg_6 + Email = arg_7 + FullName = arg_8 + Location = arg_9 + LoginName = arg_10 + MaxRepoCreation = arg_11 + MustChangePassword = arg_12 + Password = arg_13 + ProhibitLogin = arg_14 + Restricted = arg_15 + SourceId = arg_16 + Visibility = arg_17 + Website = arg_18 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Email type +[] +module EmailJsonParseExtension = + /// Extension methods for JSON parsing + type Email with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Email = + let arg_3 = + match node.["verified"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["primary"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "email" || key = "primary" || key = "verified" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Email = arg_1 + Primary = arg_2 + Verified = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the ExternalTracker type +[] +module ExternalTrackerJsonParseExtension = + /// Extension methods for JSON parsing + type ExternalTracker with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ExternalTracker = + let arg_4 = + match node.["external_tracker_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["external_tracker_style"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["external_tracker_regexp_pattern"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["external_tracker_format"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "external_tracker_format" + || key = "external_tracker_regexp_pattern" + || key = "external_tracker_style" + || key = "external_tracker_url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ExternalTrackerFormat = arg_1 + ExternalTrackerRegexpPattern = arg_2 + ExternalTrackerStyle = arg_3 + ExternalTrackerUrl = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the ExternalWiki type +[] +module ExternalWikiJsonParseExtension = + /// Extension methods for JSON parsing + type ExternalWiki with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ExternalWiki = + let arg_1 = + match node.["external_wiki_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "external_wiki_url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ExternalWikiUrl = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the FileCommitResponse type +[] +module FileCommitResponseJsonParseExtension = + /// Extension methods for JSON parsing + type FileCommitResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : FileCommitResponse = + let arg_9 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["tree"] with + | null -> None + | v -> CommitMeta.jsonParse v |> Some + + let arg_7 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["parents"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> CommitMeta.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_5 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["committer"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "author" + || key = "committer" + || key = "created" + || key = "html_url" + || key = "message" + || key = "parents" + || key = "sha" + || key = "tree" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Committer = arg_2 + Created = arg_3 + HtmlUrl = arg_4 + Message = arg_5 + Parents = arg_6 + Sha = arg_7 + Tree = arg_8 + Url = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the FileLinksResponse type +[] +module FileLinksResponseJsonParseExtension = + /// Extension methods for JSON parsing + type FileLinksResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : FileLinksResponse = + let arg_3 = + match node.["self"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["html"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["git"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "git" || key = "html" || key = "self" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Git = arg_1 + Html = arg_2 + Self = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GPGKeyEmail type +[] +module GPGKeyEmailJsonParseExtension = + /// Extension methods for JSON parsing + type GPGKeyEmail with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GPGKeyEmail = + let arg_2 = + match node.["verified"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "email" || key = "verified" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Email = arg_1 + Verified = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GeneralAPISettings type +[] +module GeneralAPISettingsJsonParseExtension = + /// Extension methods for JSON parsing + type GeneralAPISettings with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GeneralAPISettings = + let arg_4 = + match node.["max_response_items"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["default_paging_num"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["default_max_blob_size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["default_git_trees_per_page"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "default_git_trees_per_page" + || key = "default_max_blob_size" + || key = "default_paging_num" + || key = "max_response_items" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + DefaultGitTreesPerPage = arg_1 + DefaultMaxBlobSize = arg_2 + DefaultPagingNum = arg_3 + MaxResponseItems = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GeneralAttachmentSettings type +[] +module GeneralAttachmentSettingsJsonParseExtension = + /// Extension methods for JSON parsing + type GeneralAttachmentSettings with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GeneralAttachmentSettings = + let arg_4 = + match node.["max_size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["max_files"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["enabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["allowed_types"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "allowed_types" + || key = "enabled" + || key = "max_files" + || key = "max_size" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowedTypes = arg_1 + Enabled = arg_2 + MaxFiles = arg_3 + MaxSize = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GeneralRepoSettings type +[] +module GeneralRepoSettingsJsonParseExtension = + /// Extension methods for JSON parsing + type GeneralRepoSettings with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GeneralRepoSettings = + let arg_6 = + match node.["time_tracking_disabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["stars_disabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["mirrors_disabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["migrations_disabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["lfs_disabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["http_git_disabled"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "http_git_disabled" + || key = "lfs_disabled" + || key = "migrations_disabled" + || key = "mirrors_disabled" + || key = "stars_disabled" + || key = "time_tracking_disabled" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + HttpGitDisabled = arg_1 + LfsDisabled = arg_2 + MigrationsDisabled = arg_3 + MirrorsDisabled = arg_4 + StarsDisabled = arg_5 + TimeTrackingDisabled = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GeneralUISettings type +[] +module GeneralUISettingsJsonParseExtension = + /// Extension methods for JSON parsing + type GeneralUISettings with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GeneralUISettings = + let arg_3 = + match node.["default_theme"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["custom_emojis"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["allowed_reactions"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "allowed_reactions" || key = "custom_emojis" || key = "default_theme" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowedReactions = arg_1 + CustomEmojis = arg_2 + DefaultTheme = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GenerateRepoOption type +[] +module GenerateRepoOptionJsonParseExtension = + /// Extension methods for JSON parsing + type GenerateRepoOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GenerateRepoOption = + let arg_11 = + match node.["webhooks"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["topics"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["private"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + (match node.["owner"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("owner") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_7 = + (match node.["name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_6 = + match node.["labels"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["git_hooks"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["git_content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["default_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["avatar"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "avatar" + || key = "default_branch" + || key = "description" + || key = "git_content" + || key = "git_hooks" + || key = "labels" + || key = "name" + || key = "owner" + || key = "private" + || key = "topics" + || key = "webhooks" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Avatar = arg_1 + DefaultBranch = arg_2 + Description = arg_3 + GitContent = arg_4 + GitHooks = arg_5 + Labels = arg_6 + Name = arg_7 + Owner = arg_8 + Private = arg_9 + Topics = arg_10 + Webhooks = arg_11 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GitBlobResponse type +[] +module GitBlobResponseJsonParseExtension = + /// Extension methods for JSON parsing + type GitBlobResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GitBlobResponse = + let arg_5 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["encoding"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "content" + || key = "encoding" + || key = "sha" + || key = "size" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Content = arg_1 + Encoding = arg_2 + Sha = arg_3 + Size = arg_4 + Url = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GitEntry type +[] +module GitEntryJsonParseExtension = + /// Extension methods for JSON parsing + type GitEntry with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GitEntry = + let arg_6 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["path"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["mode"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "mode" + || key = "path" + || key = "sha" + || key = "size" + || key = "type" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Mode = arg_1 + Path = arg_2 + Sha = arg_3 + Size = arg_4 + Type = arg_5 + Url = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GitHook type +[] +module GitHookJsonParseExtension = + /// Extension methods for JSON parsing + type GitHook with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GitHook = + let arg_3 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["is_active"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "content" || key = "is_active" || key = "name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Content = arg_1 + IsActive = arg_2 + Name = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GitObject type +[] +module GitObjectJsonParseExtension = + /// Extension methods for JSON parsing + type GitObject with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GitObject = + let arg_3 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "sha" || key = "type" || key = "url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Sha = arg_1 + Type = arg_2 + Url = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the GitTreeResponse type +[] +module GitTreeResponseJsonParseExtension = + /// Extension methods for JSON parsing + type GitTreeResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : GitTreeResponse = + let arg_6 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["truncated"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["tree"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> GitEntry.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_3 = + match node.["total_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["page"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "page" + || key = "sha" + || key = "total_count" + || key = "tree" + || key = "truncated" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Page = arg_1 + Sha = arg_2 + TotalCount = arg_3 + Tree = arg_4 + Truncated = arg_5 + Url = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type4 type +[] +module Type4JsonParseExtension = + /// Extension methods for JSON parsing + type Type4 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type4 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Hook type +[] +module HookJsonParseExtension = + /// Extension methods for JSON parsing + type Hook with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Hook = + let arg_8 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["events"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_4 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["config"] with + | null -> None + | v -> Type4.jsonParse v |> Some + + let arg_2 = + match node.["authorization_header"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["active"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "active" + || key = "authorization_header" + || key = "config" + || key = "created_at" + || key = "events" + || key = "id" + || key = "type" + || key = "updated_at" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Active = arg_1 + AuthorizationHeader = arg_2 + Config = arg_3 + CreatedAt = arg_4 + Events = arg_5 + Id = arg_6 + Type = arg_7 + UpdatedAt = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Identity type +[] +module IdentityJsonParseExtension = + /// Extension methods for JSON parsing + type Identity with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Identity = + let arg_2 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "email" || key = "name" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Email = arg_1 + Name = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the InternalTracker type +[] +module InternalTrackerJsonParseExtension = + /// Extension methods for JSON parsing + type InternalTracker with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : InternalTracker = + let arg_3 = + match node.["enable_time_tracker"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["enable_issue_dependencies"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["allow_only_contributors_to_track_time"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "allow_only_contributors_to_track_time" + || key = "enable_issue_dependencies" + || key = "enable_time_tracker" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowOnlyContributorsToTrackTime = arg_1 + EnableIssueDependencies = arg_2 + EnableTimeTracker = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the IssueDeadline type +[] +module IssueDeadlineJsonParseExtension = + /// Extension methods for JSON parsing + type IssueDeadline with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : IssueDeadline = + let arg_1 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "due_date" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + DueDate = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type5 type +[] +module Type5JsonParseExtension = + /// Extension methods for JSON parsing + type Type5 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type5 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then () else result.Add (key, ()) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type6 type +[] +module Type6JsonParseExtension = + /// Extension methods for JSON parsing + type Type6 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type6 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then () else result.Add (key, ()) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the IssueLabelsOption type +[] +module IssueLabelsOptionJsonParseExtension = + /// Extension methods for JSON parsing + type IssueLabelsOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : IssueLabelsOption = + let arg_1 = + match node.["labels"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "labels" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Labels = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Label type +[] +module LabelJsonParseExtension = + /// Extension methods for JSON parsing + type Label with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Label = + let arg_6 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["exclusive"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["color"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "color" + || key = "description" + || key = "exclusive" + || key = "id" + || key = "name" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Color = arg_1 + Description = arg_2 + Exclusive = arg_3 + Id = arg_4 + Name = arg_5 + Url = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the MarkdownOption type +[] +module MarkdownOptionJsonParseExtension = + /// Extension methods for JSON parsing + type MarkdownOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : MarkdownOption = + let arg_4 = + match node.["Wiki"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["Text"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["Mode"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["Context"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "Context" || key = "Mode" || key = "Text" || key = "Wiki" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Context = arg_1 + Mode = arg_2 + Text = arg_3 + Wiki = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the MergePullRequestOption type +[] +module MergePullRequestOptionJsonParseExtension = + /// Extension methods for JSON parsing + type MergePullRequestOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : MergePullRequestOption = + let arg_8 = + match node.["merge_when_checks_succeed"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["head_commit_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["force_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["delete_branch_after_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["MergeTitleField"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["MergeMessageField"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["MergeCommitID"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + (match node.["Do"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("Do") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "Do" + || key = "MergeCommitID" + || key = "MergeMessageField" + || key = "MergeTitleField" + || key = "delete_branch_after_merge" + || key = "force_merge" + || key = "head_commit_id" + || key = "merge_when_checks_succeed" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Do = arg_1 + MergeCommitID = arg_2 + MergeMessageField = arg_3 + MergeTitleField = arg_4 + DeleteBranchAfterMerge = arg_5 + ForceMerge = arg_6 + HeadCommitId = arg_7 + MergeWhenChecksSucceed = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the MigrateRepoOptions type +[] +module MigrateRepoOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type MigrateRepoOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : MigrateRepoOptions = + let arg_20 = + match node.["wiki"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["uid"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["service"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["repo_owner"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + (match node.["repo_name"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("repo_name") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_15 = + match node.["releases"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["pull_requests"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["private"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["mirror_interval"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["mirror"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["milestones"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["lfs_endpoint"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["lfs"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["labels"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["issues"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + (match node.["clone_addr"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("clone_addr") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_3 = + match node.["auth_username"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["auth_token"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["auth_password"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "auth_password" + || key = "auth_token" + || key = "auth_username" + || key = "clone_addr" + || key = "description" + || key = "issues" + || key = "labels" + || key = "lfs" + || key = "lfs_endpoint" + || key = "milestones" + || key = "mirror" + || key = "mirror_interval" + || key = "private" + || key = "pull_requests" + || key = "releases" + || key = "repo_name" + || key = "repo_owner" + || key = "service" + || key = "uid" + || key = "wiki" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AuthPassword = arg_1 + AuthToken = arg_2 + AuthUsername = arg_3 + CloneAddr = arg_4 + Description = arg_5 + Issues = arg_6 + Labels = arg_7 + Lfs = arg_8 + LfsEndpoint = arg_9 + Milestones = arg_10 + Mirror = arg_11 + MirrorInterval = arg_12 + Private = arg_13 + PullRequests = arg_14 + Releases = arg_15 + RepoName = arg_16 + RepoOwner = arg_17 + Service = arg_18 + Uid = arg_19 + Wiki = arg_20 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type7 type +[] +module Type7JsonParseExtension = + /// Extension methods for JSON parsing + type Type7 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type7 = + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NodeInfoServices type +[] +module NodeInfoServicesJsonParseExtension = + /// Extension methods for JSON parsing + type NodeInfoServices with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NodeInfoServices = + let arg_2 = + match node.["outbound"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["inbound"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "inbound" || key = "outbound" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Inbound = arg_1 + Outbound = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NodeInfoSoftware type +[] +module NodeInfoSoftwareJsonParseExtension = + /// Extension methods for JSON parsing + type NodeInfoSoftware with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NodeInfoSoftware = + let arg_4 = + match node.["version"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["repository"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["homepage"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "homepage" || key = "name" || key = "repository" || key = "version" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Homepage = arg_1 + Name = arg_2 + Repository = arg_3 + Version = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NodeInfoUsageUsers type +[] +module NodeInfoUsageUsersJsonParseExtension = + /// Extension methods for JSON parsing + type NodeInfoUsageUsers with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NodeInfoUsageUsers = + let arg_3 = + match node.["total"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["activeMonth"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["activeHalfyear"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "activeHalfyear" || key = "activeMonth" || key = "total" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ActiveHalfyear = arg_1 + ActiveMonth = arg_2 + Total = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NotificationCount type +[] +module NotificationCountJsonParseExtension = + /// Extension methods for JSON parsing + type NotificationCount with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NotificationCount = + let arg_1 = + match node.["new"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "new" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + New = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the OAuth2Application type +[] +module OAuth2ApplicationJsonParseExtension = + /// Extension methods for JSON parsing + type OAuth2Application with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : OAuth2Application = + let arg_7 = + match node.["redirect_uris"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_6 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["confidential_client"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["client_secret"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["client_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "client_id" + || key = "client_secret" + || key = "confidential_client" + || key = "created" + || key = "id" + || key = "name" + || key = "redirect_uris" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ClientId = arg_1 + ClientSecret = arg_2 + ConfidentialClient = arg_3 + Created = arg_4 + Id = arg_5 + Name = arg_6 + RedirectUris = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Organization type +[] +module OrganizationJsonParseExtension = + /// Extension methods for JSON parsing + type Organization with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Organization = + let arg_10 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["visibility"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["username"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["repo_admin_change_team_access"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["avatar_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "avatar_url" + || key = "description" + || key = "full_name" + || key = "id" + || key = "location" + || key = "name" + || key = "repo_admin_change_team_access" + || key = "username" + || key = "visibility" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AvatarUrl = arg_1 + Description = arg_2 + FullName = arg_3 + Id = arg_4 + Location = arg_5 + Name = arg_6 + RepoAdminChangeTeamAccess = arg_7 + Username = arg_8 + Visibility = arg_9 + Website = arg_10 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the OrganizationPermissions type +[] +module OrganizationPermissionsJsonParseExtension = + /// Extension methods for JSON parsing + type OrganizationPermissions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : OrganizationPermissions = + let arg_5 = + match node.["is_owner"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["is_admin"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["can_write"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["can_read"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["can_create_repository"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "can_create_repository" + || key = "can_read" + || key = "can_write" + || key = "is_admin" + || key = "is_owner" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CanCreateRepository = arg_1 + CanRead = arg_2 + CanWrite = arg_3 + IsAdmin = arg_4 + IsOwner = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PackageFile type +[] +module PackageFileJsonParseExtension = + /// Extension methods for JSON parsing + type PackageFile with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PackageFile = + let arg_7 = + match node.["sha512"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["sha256"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["sha1"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["md5"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["Size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "Size" + || key = "id" + || key = "md5" + || key = "name" + || key = "sha1" + || key = "sha256" + || key = "sha512" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Size = arg_1 + Id = arg_2 + Md5 = arg_3 + Name = arg_4 + Sha1 = arg_5 + Sha256 = arg_6 + Sha512 = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PayloadUser type +[] +module PayloadUserJsonParseExtension = + /// Extension methods for JSON parsing + type PayloadUser with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PayloadUser = + let arg_3 = + match node.["username"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "email" || key = "name" || key = "username" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Email = arg_1 + Name = arg_2 + Username = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Permission type +[] +module PermissionJsonParseExtension = + /// Extension methods for JSON parsing + type Permission with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Permission = + let arg_3 = + match node.["push"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["pull"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["admin"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "admin" || key = "pull" || key = "push" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Admin = arg_1 + Pull = arg_2 + Push = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PullRequestMeta type +[] +module PullRequestMetaJsonParseExtension = + /// Extension methods for JSON parsing + type PullRequestMeta with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PullRequestMeta = + let arg_2 = + match node.["merged_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["merged"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "merged" || key = "merged_at" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Merged = arg_1 + MergedAt = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PullReviewRequestOptions type +[] +module PullReviewRequestOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type PullReviewRequestOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PullReviewRequestOptions = + let arg_2 = + match node.["team_reviewers"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["reviewers"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "reviewers" || key = "team_reviewers" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Reviewers = arg_1 + TeamReviewers = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PushMirror type +[] +module PushMirrorJsonParseExtension = + /// Extension methods for JSON parsing + type PushMirror with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PushMirror = + let arg_8 = + match node.["sync_on_commit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["repo_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["remote_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["remote_address"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["last_update"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["last_error"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["interval"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created" + || key = "interval" + || key = "last_error" + || key = "last_update" + || key = "remote_address" + || key = "remote_name" + || key = "repo_name" + || key = "sync_on_commit" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Created = arg_1 + Interval = arg_2 + LastError = arg_3 + LastUpdate = arg_4 + RemoteAddress = arg_5 + RemoteName = arg_6 + RepoName = arg_7 + SyncOnCommit = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Reference type +[] +module ReferenceJsonParseExtension = + /// Extension methods for JSON parsing + type Reference with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Reference = + let arg_3 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["object"] with + | null -> None + | v -> GitObject.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "object" || key = "ref" || key = "url" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Object = arg_1 + Ref = arg_2 + Url = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the RepoTopicOptions type +[] +module RepoTopicOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type RepoTopicOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : RepoTopicOptions = + let arg_1 = + match node.["topics"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "topics" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Topics = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the RepositoryMeta type +[] +module RepositoryMetaJsonParseExtension = + /// Extension methods for JSON parsing + type RepositoryMeta with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : RepositoryMeta = + let arg_4 = + match node.["owner"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "full_name" || key = "id" || key = "name" || key = "owner" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + FullName = arg_1 + Id = arg_2 + Name = arg_3 + Owner = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the ServerVersion type +[] +module ServerVersionJsonParseExtension = + /// Extension methods for JSON parsing + type ServerVersion with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ServerVersion = + let arg_1 = + match node.["version"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "version" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Version = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the StopWatch type +[] +module StopWatchJsonParseExtension = + /// Extension methods for JSON parsing + type StopWatch with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : StopWatch = + let arg_7 = + match node.["seconds"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["repo_owner_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["repo_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["issue_title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["issue_index"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["duration"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created" + || key = "duration" + || key = "issue_index" + || key = "issue_title" + || key = "repo_name" + || key = "repo_owner_name" + || key = "seconds" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Created = arg_1 + Duration = arg_2 + IssueIndex = arg_3 + IssueTitle = arg_4 + RepoName = arg_5 + RepoOwnerName = arg_6 + Seconds = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the SubmitPullReviewOptions type +[] +module SubmitPullReviewOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type SubmitPullReviewOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : SubmitPullReviewOptions = + let arg_2 = + match node.["event"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "body" || key = "event" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + Event = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Tag type +[] +module TagJsonParseExtension = + /// Extension methods for JSON parsing + type Tag with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Tag = + let arg_6 = + match node.["zipball_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["tarball_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["commit"] with + | null -> None + | v -> CommitMeta.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "commit" + || key = "id" + || key = "message" + || key = "name" + || key = "tarball_url" + || key = "zipball_url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Commit = arg_1 + Id = arg_2 + Message = arg_3 + Name = arg_4 + TarballUrl = arg_5 + ZipballUrl = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Type8 type +[] +module Type8JsonParseExtension = + /// Extension methods for JSON parsing + type Type8 with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Type8 = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Team type +[] +module TeamJsonParseExtension = + /// Extension methods for JSON parsing + type Team with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Team = + let arg_9 = + match node.["units_map"] with + | null -> None + | v -> Type8.jsonParse v |> Some + + let arg_8 = + match node.["units"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_7 = + match node.["permission"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["organization"] with + | null -> None + | v -> Organization.jsonParse v |> Some + + let arg_5 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["includes_all_repositories"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["can_create_org_repo"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "can_create_org_repo" + || key = "description" + || key = "id" + || key = "includes_all_repositories" + || key = "name" + || key = "organization" + || key = "permission" + || key = "units" + || key = "units_map" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CanCreateOrgRepo = arg_1 + Description = arg_2 + Id = arg_3 + IncludesAllRepositories = arg_4 + Name = arg_5 + Organization = arg_6 + Permission = arg_7 + Units = arg_8 + UnitsMap = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the TopicName type +[] +module TopicNameJsonParseExtension = + /// Extension methods for JSON parsing + type TopicName with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : TopicName = + let arg_1 = + match node.["topics"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "topics" then () else result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Topics = arg_1 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the TopicResponse type +[] +module TopicResponseJsonParseExtension = + /// Extension methods for JSON parsing + type TopicResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : TopicResponse = + let arg_5 = + match node.["updated"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["topic_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["repo_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created" + || key = "id" + || key = "repo_count" + || key = "topic_name" + || key = "updated" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Created = arg_1 + Id = arg_2 + RepoCount = arg_3 + TopicName = arg_4 + Updated = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the TransferRepoOption type +[] +module TransferRepoOptionJsonParseExtension = + /// Extension methods for JSON parsing + type TransferRepoOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : TransferRepoOption = + let arg_2 = + match node.["team_ids"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_1 = + (match node.["new_owner"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("new_owner") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "new_owner" || key = "team_ids" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + NewOwner = arg_1 + TeamIds = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the UpdateFileOptions type +[] +module UpdateFileOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type UpdateFileOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : UpdateFileOptions = + let arg_10 = + match node.["signoff"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + (match node.["sha"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("sha") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_8 = + match node.["new_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["from_path"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["dates"] with + | null -> None + | v -> CommitDateOptions.jsonParse v |> Some + + let arg_4 = + (match node.["content"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("content") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_3 = + match node.["committer"] with + | null -> None + | v -> Identity.jsonParse v |> Some + + let arg_2 = + match node.["branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> Identity.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "author" + || key = "branch" + || key = "committer" + || key = "content" + || key = "dates" + || key = "from_path" + || key = "message" + || key = "new_branch" + || key = "sha" + || key = "signoff" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Branch = arg_2 + Committer = arg_3 + Content = arg_4 + Dates = arg_5 + FromPath = arg_6 + Message = arg_7 + NewBranch = arg_8 + Sha = arg_9 + Signoff = arg_10 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the User type +[] +module UserJsonParseExtension = + /// Extension methods for JSON parsing + type User with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : User = + let arg_20 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["visibility"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["starred_repos_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["restricted"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + match node.["prohibit_login"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_15 = + match node.["login_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["login"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["last_login"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["language"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["is_admin"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["following_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["followers_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["avatar_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["active"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "active" + || key = "avatar_url" + || key = "created" + || key = "description" + || key = "email" + || key = "followers_count" + || key = "following_count" + || key = "full_name" + || key = "id" + || key = "is_admin" + || key = "language" + || key = "last_login" + || key = "location" + || key = "login" + || key = "login_name" + || key = "prohibit_login" + || key = "restricted" + || key = "starred_repos_count" + || key = "visibility" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Active = arg_1 + AvatarUrl = arg_2 + Created = arg_3 + Description = arg_4 + Email = arg_5 + FollowersCount = arg_6 + FollowingCount = arg_7 + FullName = arg_8 + Id = arg_9 + IsAdmin = arg_10 + Language = arg_11 + LastLogin = arg_12 + Location = arg_13 + Login = arg_14 + LoginName = arg_15 + ProhibitLogin = arg_16 + Restricted = arg_17 + StarredReposCount = arg_18 + Visibility = arg_19 + Website = arg_20 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the UserHeatmapData type +[] +module UserHeatmapDataJsonParseExtension = + /// Extension methods for JSON parsing + type UserHeatmapData with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : UserHeatmapData = + let arg_2 = + match node.["timestamp"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["contributions"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "contributions" || key = "timestamp" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Contributions = arg_1 + Timestamp = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the UserSettings type +[] +module UserSettingsJsonParseExtension = + /// Extension methods for JSON parsing + type UserSettings with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : UserSettings = + let arg_9 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["theme"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["language"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["hide_email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["hide_activity"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["diff_view_style"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "description" + || key = "diff_view_style" + || key = "full_name" + || key = "hide_activity" + || key = "hide_email" + || key = "language" + || key = "location" + || key = "theme" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Description = arg_1 + DiffViewStyle = arg_2 + FullName = arg_3 + HideActivity = arg_4 + HideEmail = arg_5 + Language = arg_6 + Location = arg_7 + Theme = arg_8 + Website = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the UserSettingsOptions type +[] +module UserSettingsOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type UserSettingsOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : UserSettingsOptions = + let arg_9 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["theme"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["location"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["language"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["hide_email"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["hide_activity"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["diff_view_style"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "description" + || key = "diff_view_style" + || key = "full_name" + || key = "hide_activity" + || key = "hide_email" + || key = "language" + || key = "location" + || key = "theme" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Description = arg_1 + DiffViewStyle = arg_2 + FullName = arg_3 + HideActivity = arg_4 + HideEmail = arg_5 + Language = arg_6 + Location = arg_7 + Theme = arg_8 + Website = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the WatchInfo type +[] +module WatchInfoJsonParseExtension = + /// Extension methods for JSON parsing + type WatchInfo with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : WatchInfo = + let arg_6 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["subscribed"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["repository_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["reason"] with + | null -> None + | v -> () |> Some + + let arg_2 = + match node.["ignored"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created_at" + || key = "ignored" + || key = "reason" + || key = "repository_url" + || key = "subscribed" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CreatedAt = arg_1 + Ignored = arg_2 + Reason = arg_3 + RepositoryUrl = arg_4 + Subscribed = arg_5 + Url = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the WikiCommit type +[] +module WikiCommitJsonParseExtension = + /// Extension methods for JSON parsing + type WikiCommit with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : WikiCommit = + let arg_4 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["commiter"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "author" || key = "commiter" || key = "message" || key = "sha" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Commiter = arg_2 + Message = arg_3 + Sha = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the WikiCommitList type +[] +module WikiCommitListJsonParseExtension = + /// Extension methods for JSON parsing + type WikiCommitList with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : WikiCommitList = + let arg_2 = + match node.["count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["commits"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> WikiCommit.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "commits" || key = "count" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Commits = arg_1 + Count = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the WikiPage type +[] +module WikiPageJsonParseExtension = + /// Extension methods for JSON parsing + type WikiPage with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : WikiPage = + let arg_8 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["sub_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["sidebar"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["last_commit"] with + | null -> None + | v -> WikiCommit.jsonParse v |> Some + + let arg_4 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["footer"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["content_base64"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["commit_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "commit_count" + || key = "content_base64" + || key = "footer" + || key = "html_url" + || key = "last_commit" + || key = "sidebar" + || key = "sub_url" + || key = "title" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CommitCount = arg_1 + ContentBase64 = arg_2 + Footer = arg_3 + HtmlUrl = arg_4 + LastCommit = arg_5 + Sidebar = arg_6 + SubUrl = arg_7 + Title = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the WikiPageMetaData type +[] +module WikiPageMetaDataJsonParseExtension = + /// Extension methods for JSON parsing + type WikiPageMetaData with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : WikiPageMetaData = + let arg_4 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["sub_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["last_commit"] with + | null -> None + | v -> WikiCommit.jsonParse v |> Some + + let arg_1 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "html_url" || key = "last_commit" || key = "sub_url" || key = "title" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + HtmlUrl = arg_1 + LastCommit = arg_2 + SubUrl = arg_3 + Title = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Comment type +[] +module CommentJsonParseExtension = + /// Extension methods for JSON parsing + type Comment with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Comment = + let arg_11 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_10 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["pull_request_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["original_author_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["original_author"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["issue_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["assets"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> Attachment.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assets" + || key = "body" + || key = "created_at" + || key = "html_url" + || key = "id" + || key = "issue_url" + || key = "original_author" + || key = "original_author_id" + || key = "pull_request_url" + || key = "updated_at" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assets = arg_1 + Body = arg_2 + CreatedAt = arg_3 + HtmlUrl = arg_4 + Id = arg_5 + IssueUrl = arg_6 + OriginalAuthor = arg_7 + OriginalAuthorId = arg_8 + PullRequestUrl = arg_9 + UpdatedAt = arg_10 + User = arg_11 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CommitStatus type +[] +module CommitStatusJsonParseExtension = + /// Extension methods for JSON parsing + type CommitStatus with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CommitStatus = + let arg_9 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["target_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["status"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["creator"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_2 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["context"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "context" + || key = "created_at" + || key = "creator" + || key = "description" + || key = "id" + || key = "status" + || key = "target_url" + || key = "updated_at" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Context = arg_1 + CreatedAt = arg_2 + Creator = arg_3 + Description = arg_4 + Id = arg_5 + Status = arg_6 + TargetUrl = arg_7 + UpdatedAt = arg_8 + Url = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the ContentsResponse type +[] +module ContentsResponseJsonParseExtension = + /// Extension methods for JSON parsing + type ContentsResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ContentsResponse = + let arg_15 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["target"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["submodule_git_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["path"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["last_commit_sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["git_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["encoding"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["download_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["_links"] with + | null -> None + | v -> FileLinksResponse.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "_links" + || key = "content" + || key = "download_url" + || key = "encoding" + || key = "git_url" + || key = "html_url" + || key = "last_commit_sha" + || key = "name" + || key = "path" + || key = "sha" + || key = "size" + || key = "submodule_git_url" + || key = "target" + || key = "type" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Links = arg_1 + Content = arg_2 + DownloadUrl = arg_3 + Encoding = arg_4 + GitUrl = arg_5 + HtmlUrl = arg_6 + LastCommitSha = arg_7 + Name = arg_8 + Path = arg_9 + Sha = arg_10 + Size = arg_11 + SubmoduleGitUrl = arg_12 + Target = arg_13 + Type = arg_14 + Url = arg_15 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateFileOptions type +[] +module CreateFileOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type CreateFileOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateFileOptions = + let arg_8 = + match node.["signoff"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["new_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["dates"] with + | null -> None + | v -> CommitDateOptions.jsonParse v |> Some + + let arg_4 = + (match node.["content"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("content") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_3 = + match node.["committer"] with + | null -> None + | v -> Identity.jsonParse v |> Some + + let arg_2 = + match node.["branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> Identity.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "author" + || key = "branch" + || key = "committer" + || key = "content" + || key = "dates" + || key = "message" + || key = "new_branch" + || key = "signoff" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Branch = arg_2 + Committer = arg_3 + Content = arg_4 + Dates = arg_5 + Message = arg_6 + NewBranch = arg_7 + Signoff = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreateHookOption type +[] +module CreateHookOptionJsonParseExtension = + /// Extension methods for JSON parsing + type CreateHookOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreateHookOption = + let arg_6 = + (match node.["type"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("type") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_5 = + match node.["events"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_4 = + CreateHookOptionConfig.jsonParse ( + match node.["config"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("config") + ) + ) + | v -> v + ) + + let arg_3 = + match node.["branch_filter"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["authorization_header"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["active"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "active" + || key = "authorization_header" + || key = "branch_filter" + || key = "config" + || key = "events" + || key = "type" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Active = arg_1 + AuthorizationHeader = arg_2 + BranchFilter = arg_3 + Config = arg_4 + Events = arg_5 + Type = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CreatePullReviewOptions type +[] +module CreatePullReviewOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type CreatePullReviewOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CreatePullReviewOptions = + let arg_4 = + match node.["event"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["commit_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["comments"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> CreatePullReviewComment.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "body" || key = "comments" || key = "commit_id" || key = "event" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + Comments = arg_2 + CommitId = arg_3 + Event = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the DeleteFileOptions type +[] +module DeleteFileOptionsJsonParseExtension = + /// Extension methods for JSON parsing + type DeleteFileOptions with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : DeleteFileOptions = + let arg_8 = + match node.["signoff"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + (match node.["sha"] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" ("sha") + ) + ) + | v -> v) + .AsValue() + .GetValue () + + let arg_6 = + match node.["new_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["dates"] with + | null -> None + | v -> CommitDateOptions.jsonParse v |> Some + + let arg_3 = + match node.["committer"] with + | null -> None + | v -> Identity.jsonParse v |> Some + + let arg_2 = + match node.["branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> Identity.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "author" + || key = "branch" + || key = "committer" + || key = "dates" + || key = "message" + || key = "new_branch" + || key = "sha" + || key = "signoff" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Branch = arg_2 + Committer = arg_3 + Dates = arg_4 + Message = arg_5 + NewBranch = arg_6 + Sha = arg_7 + Signoff = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the EditRepoOption type +[] +module EditRepoOptionJsonParseExtension = + /// Extension methods for JSON parsing + type EditRepoOption with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : EditRepoOption = + let arg_27 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_26 = + match node.["template"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_25 = + match node.["private"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_24 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_23 = + match node.["mirror_interval"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_22 = + match node.["internal_tracker"] with + | null -> None + | v -> InternalTracker.jsonParse v |> Some + + let arg_21 = + match node.["ignore_whitespace_conflicts"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["has_wiki"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["has_pull_requests"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["has_projects"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["has_issues"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + match node.["external_wiki"] with + | null -> None + | v -> ExternalWiki.jsonParse v |> Some + + let arg_15 = + match node.["external_tracker"] with + | null -> None + | v -> ExternalTracker.jsonParse v |> Some + + let arg_14 = + match node.["enable_prune"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["default_merge_style"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["default_delete_branch_after_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["default_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["default_allow_maintainer_edit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["autodetect_manual_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["archived"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["allow_squash_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["allow_rebase_update"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["allow_rebase_explicit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["allow_rebase"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["allow_merge_commits"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["allow_manual_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "allow_manual_merge" + || key = "allow_merge_commits" + || key = "allow_rebase" + || key = "allow_rebase_explicit" + || key = "allow_rebase_update" + || key = "allow_squash_merge" + || key = "archived" + || key = "autodetect_manual_merge" + || key = "default_allow_maintainer_edit" + || key = "default_branch" + || key = "default_delete_branch_after_merge" + || key = "default_merge_style" + || key = "description" + || key = "enable_prune" + || key = "external_tracker" + || key = "external_wiki" + || key = "has_issues" + || key = "has_projects" + || key = "has_pull_requests" + || key = "has_wiki" + || key = "ignore_whitespace_conflicts" + || key = "internal_tracker" + || key = "mirror_interval" + || key = "name" + || key = "private" + || key = "template" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowManualMerge = arg_1 + AllowMergeCommits = arg_2 + AllowRebase = arg_3 + AllowRebaseExplicit = arg_4 + AllowRebaseUpdate = arg_5 + AllowSquashMerge = arg_6 + Archived = arg_7 + AutodetectManualMerge = arg_8 + DefaultAllowMaintainerEdit = arg_9 + DefaultBranch = arg_10 + DefaultDeleteBranchAfterMerge = arg_11 + DefaultMergeStyle = arg_12 + Description = arg_13 + EnablePrune = arg_14 + ExternalTracker = arg_15 + ExternalWiki = arg_16 + HasIssues = arg_17 + HasProjects = arg_18 + HasPullRequests = arg_19 + HasWiki = arg_20 + IgnoreWhitespaceConflicts = arg_21 + InternalTracker = arg_22 + MirrorInterval = arg_23 + Name = arg_24 + Private = arg_25 + Template = arg_26 + Website = arg_27 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the IssueFormField type +[] +module IssueFormFieldJsonParseExtension = + /// Extension methods for JSON parsing + type IssueFormField with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : IssueFormField = + let arg_4 = + match node.["validations"] with + | null -> None + | v -> Type6.jsonParse v |> Some + + let arg_3 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["attributes"] with + | null -> None + | v -> Type5.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "attributes" || key = "id" || key = "type" || key = "validations" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Attributes = arg_1 + Id = arg_2 + Type = arg_3 + Validations = arg_4 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the IssueTemplate type +[] +module IssueTemplateJsonParseExtension = + /// Extension methods for JSON parsing + type IssueTemplate with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : IssueTemplate = + let arg_8 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["labels"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_4 = + match node.["file_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["body"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> IssueFormField.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_1 = + match node.["about"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "about" + || key = "body" + || key = "content" + || key = "file_name" + || key = "labels" + || key = "name" + || key = "ref" + || key = "title" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + About = arg_1 + Body = arg_2 + Content = arg_3 + FileName = arg_4 + Labels = arg_5 + Name = arg_6 + Ref = arg_7 + Title = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Milestone type +[] +module MilestoneJsonParseExtension = + /// Extension methods for JSON parsing + type Milestone with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Milestone = + let arg_10 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["open_issues"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["due_on"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["closed_issues"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["closed_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "closed_at" + || key = "closed_issues" + || key = "created_at" + || key = "description" + || key = "due_on" + || key = "id" + || key = "open_issues" + || key = "state" + || key = "title" + || key = "updated_at" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + ClosedAt = arg_1 + ClosedIssues = arg_2 + CreatedAt = arg_3 + Description = arg_4 + DueOn = arg_5 + Id = arg_6 + OpenIssues = arg_7 + State = arg_8 + Title = arg_9 + UpdatedAt = arg_10 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NodeInfoUsage type +[] +module NodeInfoUsageJsonParseExtension = + /// Extension methods for JSON parsing + type NodeInfoUsage with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NodeInfoUsage = + let arg_3 = + match node.["users"] with + | null -> None + | v -> NodeInfoUsageUsers.jsonParse v |> Some + + let arg_2 = + match node.["localPosts"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["localComments"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "localComments" || key = "localPosts" || key = "users" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + LocalComments = arg_1 + LocalPosts = arg_2 + Users = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NotificationSubject type +[] +module NotificationSubjectJsonParseExtension = + /// Extension methods for JSON parsing + type NotificationSubject with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NotificationSubject = + let arg_7 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["latest_comment_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["latest_comment_html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "html_url" + || key = "latest_comment_html_url" + || key = "latest_comment_url" + || key = "state" + || key = "title" + || key = "type" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + HtmlUrl = arg_1 + LatestCommentHtmlUrl = arg_2 + LatestCommentUrl = arg_3 + State = arg_4 + Title = arg_5 + Type = arg_6 + Url = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PayloadCommitVerification type +[] +module PayloadCommitVerificationJsonParseExtension = + /// Extension methods for JSON parsing + type PayloadCommitVerification with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PayloadCommitVerification = + let arg_5 = + match node.["verified"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["signer"] with + | null -> None + | v -> PayloadUser.jsonParse v |> Some + + let arg_3 = + match node.["signature"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["reason"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["payload"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "payload" + || key = "reason" + || key = "signature" + || key = "signer" + || key = "verified" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Payload = arg_1 + Reason = arg_2 + Signature = arg_3 + Signer = arg_4 + Verified = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PublicKey type +[] +module PublicKeyJsonParseExtension = + /// Extension methods for JSON parsing + type PublicKey with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PublicKey = + let arg_9 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_8 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["read_only"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["key_type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["key"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["fingerprint"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created_at" + || key = "fingerprint" + || key = "id" + || key = "key" + || key = "key_type" + || key = "read_only" + || key = "title" + || key = "url" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CreatedAt = arg_1 + Fingerprint = arg_2 + Id = arg_3 + Key = arg_4 + KeyType = arg_5 + ReadOnly = arg_6 + Title = arg_7 + Url = arg_8 + User = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PullReview type +[] +module PullReviewJsonParseExtension = + /// Extension methods for JSON parsing + type PullReview with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PullReview = + let arg_14 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_13 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["team"] with + | null -> None + | v -> Team.jsonParse v |> Some + + let arg_11 = + match node.["submitted_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["stale"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["pull_request_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["official"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["dismissed"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["commit_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["comments_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "body" + || key = "comments_count" + || key = "commit_id" + || key = "dismissed" + || key = "html_url" + || key = "id" + || key = "official" + || key = "pull_request_url" + || key = "stale" + || key = "state" + || key = "submitted_at" + || key = "team" + || key = "updated_at" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + CommentsCount = arg_2 + CommitId = arg_3 + Dismissed = arg_4 + HtmlUrl = arg_5 + Id = arg_6 + Official = arg_7 + PullRequestUrl = arg_8 + Stale = arg_9 + State = arg_10 + SubmittedAt = arg_11 + Team = arg_12 + UpdatedAt = arg_13 + User = arg_14 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PullReviewComment type +[] +module PullReviewCommentJsonParseExtension = + /// Extension methods for JSON parsing + type PullReviewComment with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PullReviewComment = + let arg_15 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_14 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["resolver"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_12 = + match node.["pull_request_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["pull_request_review_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["position"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["path"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["original_position"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["original_commit_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["diff_hunk"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["commit_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "body" + || key = "commit_id" + || key = "created_at" + || key = "diff_hunk" + || key = "html_url" + || key = "id" + || key = "original_commit_id" + || key = "original_position" + || key = "path" + || key = "position" + || key = "pull_request_review_id" + || key = "pull_request_url" + || key = "resolver" + || key = "updated_at" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Body = arg_1 + CommitId = arg_2 + CreatedAt = arg_3 + DiffHunk = arg_4 + HtmlUrl = arg_5 + Id = arg_6 + OriginalCommitId = arg_7 + OriginalPosition = arg_8 + Path = arg_9 + Position = arg_10 + PullRequestReviewId = arg_11 + PullRequestUrl = arg_12 + Resolver = arg_13 + UpdatedAt = arg_14 + User = arg_15 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Reaction type +[] +module ReactionJsonParseExtension = + /// Extension methods for JSON parsing + type Reaction with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Reaction = + let arg_3 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_2 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["content"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "content" || key = "created_at" || key = "user" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Content = arg_1 + CreatedAt = arg_2 + User = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Release type +[] +module ReleaseJsonParseExtension = + /// Extension methods for JSON parsing + type Release with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Release = + let arg_15 = + match node.["zipball_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["target_commitish"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["tarball_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["tag_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["published_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["prerelease"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["draft"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["author"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_1 = + match node.["assets"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> Attachment.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assets" + || key = "author" + || key = "body" + || key = "created_at" + || key = "draft" + || key = "html_url" + || key = "id" + || key = "name" + || key = "prerelease" + || key = "published_at" + || key = "tag_name" + || key = "tarball_url" + || key = "target_commitish" + || key = "url" + || key = "zipball_url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assets = arg_1 + Author = arg_2 + Body = arg_3 + CreatedAt = arg_4 + Draft = arg_5 + HtmlUrl = arg_6 + Id = arg_7 + Name = arg_8 + Prerelease = arg_9 + PublishedAt = arg_10 + TagName = arg_11 + TarballUrl = arg_12 + TargetCommitish = arg_13 + Url = arg_14 + ZipballUrl = arg_15 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the RepoCollaboratorPermission type +[] +module RepoCollaboratorPermissionJsonParseExtension = + /// Extension methods for JSON parsing + type RepoCollaboratorPermission with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : RepoCollaboratorPermission = + let arg_3 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_2 = + match node.["role_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["permission"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "permission" || key = "role_name" || key = "user" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Permission = arg_1 + RoleName = arg_2 + User = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the RepoCommit type +[] +module RepoCommitJsonParseExtension = + /// Extension methods for JSON parsing + type RepoCommit with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : RepoCommit = + let arg_6 = + match node.["verification"] with + | null -> None + | v -> PayloadCommitVerification.jsonParse v |> Some + + let arg_5 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["tree"] with + | null -> None + | v -> CommitMeta.jsonParse v |> Some + + let arg_3 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["committer"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "author" + || key = "committer" + || key = "message" + || key = "tree" + || key = "url" + || key = "verification" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Committer = arg_2 + Message = arg_3 + Tree = arg_4 + Url = arg_5 + Verification = arg_6 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the RepoTransfer type +[] +module RepoTransferJsonParseExtension = + /// Extension methods for JSON parsing + type RepoTransfer with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : RepoTransfer = + let arg_3 = + match node.["teams"] with + | null -> None + | v -> v.AsArray () |> Seq.map (fun elt -> Team.jsonParse elt) |> List.ofSeq |> Some + + let arg_2 = + match node.["recipient"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_1 = + match node.["doer"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "doer" || key = "recipient" || key = "teams" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Doer = arg_1 + Recipient = arg_2 + Teams = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Repository type +[] +module RepositoryJsonParseExtension = + /// Extension methods for JSON parsing + type Repository with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Repository = + let arg_52 = + match node.["website"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_51 = + match node.["watchers_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_50 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_49 = + match node.["template"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_48 = + match node.["stars_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_47 = + match node.["ssh_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_46 = + match node.["size"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_45 = + match node.["repo_transfer"] with + | null -> None + | v -> RepoTransfer.jsonParse v |> Some + + let arg_44 = + match node.["release_counter"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_43 = + match node.["private"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_42 = + match node.["permissions"] with + | null -> None + | v -> Permission.jsonParse v |> Some + + let arg_41 = + match node.["parent"] with + | null -> None + | v -> Repository.jsonParse v |> Some + + let arg_40 = + match node.["owner"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_39 = + match node.["original_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_38 = + match node.["open_pr_counter"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_37 = + match node.["open_issues_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_36 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_35 = + match node.["mirror_updated"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_34 = + match node.["mirror_interval"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_33 = + match node.["mirror"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_32 = + match node.["link"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_31 = + match node.["languages_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_30 = + match node.["language"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_29 = + match node.["internal_tracker"] with + | null -> None + | v -> InternalTracker.jsonParse v |> Some + + let arg_28 = + match node.["internal"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_27 = + match node.["ignore_whitespace_conflicts"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_26 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_25 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_24 = + match node.["has_wiki"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_23 = + match node.["has_pull_requests"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_22 = + match node.["has_projects"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_21 = + match node.["has_issues"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["full_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["forks_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["fork"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["external_wiki"] with + | null -> None + | v -> ExternalWiki.jsonParse v |> Some + + let arg_16 = + match node.["external_tracker"] with + | null -> None + | v -> ExternalTracker.jsonParse v |> Some + + let arg_15 = + match node.["empty"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["description"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["default_merge_style"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["default_delete_branch_after_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["default_branch"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["default_allow_maintainer_edit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["clone_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["avatar_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["archived"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["allow_squash_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["allow_rebase_update"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["allow_rebase_explicit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["allow_rebase"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["allow_merge_commits"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "allow_merge_commits" + || key = "allow_rebase" + || key = "allow_rebase_explicit" + || key = "allow_rebase_update" + || key = "allow_squash_merge" + || key = "archived" + || key = "avatar_url" + || key = "clone_url" + || key = "created_at" + || key = "default_allow_maintainer_edit" + || key = "default_branch" + || key = "default_delete_branch_after_merge" + || key = "default_merge_style" + || key = "description" + || key = "empty" + || key = "external_tracker" + || key = "external_wiki" + || key = "fork" + || key = "forks_count" + || key = "full_name" + || key = "has_issues" + || key = "has_projects" + || key = "has_pull_requests" + || key = "has_wiki" + || key = "html_url" + || key = "id" + || key = "ignore_whitespace_conflicts" + || key = "internal" + || key = "internal_tracker" + || key = "language" + || key = "languages_url" + || key = "link" + || key = "mirror" + || key = "mirror_interval" + || key = "mirror_updated" + || key = "name" + || key = "open_issues_count" + || key = "open_pr_counter" + || key = "original_url" + || key = "owner" + || key = "parent" + || key = "permissions" + || key = "private" + || key = "release_counter" + || key = "repo_transfer" + || key = "size" + || key = "ssh_url" + || key = "stars_count" + || key = "template" + || key = "updated_at" + || key = "watchers_count" + || key = "website" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowMergeCommits = arg_1 + AllowRebase = arg_2 + AllowRebaseExplicit = arg_3 + AllowRebaseUpdate = arg_4 + AllowSquashMerge = arg_5 + Archived = arg_6 + AvatarUrl = arg_7 + CloneUrl = arg_8 + CreatedAt = arg_9 + DefaultAllowMaintainerEdit = arg_10 + DefaultBranch = arg_11 + DefaultDeleteBranchAfterMerge = arg_12 + DefaultMergeStyle = arg_13 + Description = arg_14 + Empty = arg_15 + ExternalTracker = arg_16 + ExternalWiki = arg_17 + Fork = arg_18 + ForksCount = arg_19 + FullName = arg_20 + HasIssues = arg_21 + HasProjects = arg_22 + HasPullRequests = arg_23 + HasWiki = arg_24 + HtmlUrl = arg_25 + Id = arg_26 + IgnoreWhitespaceConflicts = arg_27 + Internal = arg_28 + InternalTracker = arg_29 + Language = arg_30 + LanguagesUrl = arg_31 + Link = arg_32 + Mirror = arg_33 + MirrorInterval = arg_34 + MirrorUpdated = arg_35 + Name = arg_36 + OpenIssuesCount = arg_37 + OpenPrCounter = arg_38 + OriginalUrl = arg_39 + Owner = arg_40 + Parent = arg_41 + Permissions = arg_42 + Private = arg_43 + ReleaseCounter = arg_44 + RepoTransfer = arg_45 + Size = arg_46 + SshUrl = arg_47 + StarsCount = arg_48 + Template = arg_49 + UpdatedAt = arg_50 + WatchersCount = arg_51 + Website = arg_52 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the SearchResults type +[] +module SearchResultsJsonParseExtension = + /// Extension methods for JSON parsing + type SearchResults with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : SearchResults = + let arg_2 = + match node.["ok"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["data"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> Repository.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "data" || key = "ok" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Data = arg_1 + Ok = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the AnnotatedTag type +[] +module AnnotatedTagJsonParseExtension = + /// Extension methods for JSON parsing + type AnnotatedTag with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : AnnotatedTag = + let arg_7 = + match node.["verification"] with + | null -> None + | v -> PayloadCommitVerification.jsonParse v |> Some + + let arg_6 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["tagger"] with + | null -> None + | v -> CommitUser.jsonParse v |> Some + + let arg_4 = + match node.["tag"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["object"] with + | null -> None + | v -> AnnotatedTagObject.jsonParse v |> Some + + let arg_1 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "message" + || key = "object" + || key = "sha" + || key = "tag" + || key = "tagger" + || key = "url" + || key = "verification" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Message = arg_1 + Object = arg_2 + Sha = arg_3 + Tag = arg_4 + Tagger = arg_5 + Url = arg_6 + Verification = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the CombinedStatus type +[] +module CombinedStatusJsonParseExtension = + /// Extension methods for JSON parsing + type CombinedStatus with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : CombinedStatus = + let arg_7 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["total_count"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["statuses"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> CommitStatus.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_4 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["repository"] with + | null -> None + | v -> Repository.jsonParse v |> Some + + let arg_1 = + match node.["commit_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "commit_url" + || key = "repository" + || key = "sha" + || key = "state" + || key = "statuses" + || key = "total_count" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CommitUrl = arg_1 + Repository = arg_2 + Sha = arg_3 + State = arg_4 + Statuses = arg_5 + TotalCount = arg_6 + Url = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Commit type +[] +module CommitJsonParseExtension = + /// Extension methods for JSON parsing + type Commit with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Commit = + let arg_10 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["stats"] with + | null -> None + | v -> CommitStats.jsonParse v |> Some + + let arg_8 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["parents"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> CommitMeta.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_6 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["files"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> CommitAffectedFiles.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_4 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["committer"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_2 = + match node.["commit"] with + | null -> None + | v -> RepoCommit.jsonParse v |> Some + + let arg_1 = + match node.["author"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "author" + || key = "commit" + || key = "committer" + || key = "created" + || key = "files" + || key = "html_url" + || key = "parents" + || key = "sha" + || key = "stats" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Author = arg_1 + Commit = arg_2 + Committer = arg_3 + Created = arg_4 + Files = arg_5 + HtmlUrl = arg_6 + Parents = arg_7 + Sha = arg_8 + Stats = arg_9 + Url = arg_10 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the DeployKey type +[] +module DeployKeyJsonParseExtension = + /// Extension methods for JSON parsing + type DeployKey with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : DeployKey = + let arg_9 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["repository"] with + | null -> None + | v -> Repository.jsonParse v |> Some + + let arg_6 = + match node.["read_only"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["key_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["key"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["fingerprint"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created_at" + || key = "fingerprint" + || key = "id" + || key = "key" + || key = "key_id" + || key = "read_only" + || key = "repository" + || key = "title" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CreatedAt = arg_1 + Fingerprint = arg_2 + Id = arg_3 + Key = arg_4 + KeyId = arg_5 + ReadOnly = arg_6 + Repository = arg_7 + Title = arg_8 + Url = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the FileDeleteResponse type +[] +module FileDeleteResponseJsonParseExtension = + /// Extension methods for JSON parsing + type FileDeleteResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : FileDeleteResponse = + let arg_3 = + match node.["verification"] with + | null -> None + | v -> PayloadCommitVerification.jsonParse v |> Some + + let arg_2 = + match node.["content"] with + | null -> None + | v -> () |> Some + + let arg_1 = + match node.["commit"] with + | null -> None + | v -> FileCommitResponse.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "commit" || key = "content" || key = "verification" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Commit = arg_1 + Content = arg_2 + Verification = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the FileResponse type +[] +module FileResponseJsonParseExtension = + /// Extension methods for JSON parsing + type FileResponse with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : FileResponse = + let arg_3 = + match node.["verification"] with + | null -> None + | v -> PayloadCommitVerification.jsonParse v |> Some + + let arg_2 = + match node.["content"] with + | null -> None + | v -> ContentsResponse.jsonParse v |> Some + + let arg_1 = + match node.["commit"] with + | null -> None + | v -> FileCommitResponse.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "commit" || key = "content" || key = "verification" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Commit = arg_1 + Content = arg_2 + Verification = arg_3 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Issue type +[] +module IssueJsonParseExtension = + /// Extension methods for JSON parsing + type Issue with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Issue = + let arg_24 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_23 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_22 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_21 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["repository"] with + | null -> None + | v -> RepositoryMeta.jsonParse v |> Some + + let arg_18 = + match node.["ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["pull_request"] with + | null -> None + | v -> PullRequestMeta.jsonParse v |> Some + + let arg_16 = + match node.["original_author_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_15 = + match node.["original_author"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["number"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["milestone"] with + | null -> None + | v -> Milestone.jsonParse v |> Some + + let arg_12 = + match node.["labels"] with + | null -> None + | v -> v.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq |> Some + + let arg_11 = + match node.["is_locked"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["comments"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["closed_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["assignees"] with + | null -> None + | v -> v.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq |> Some + + let arg_2 = + match node.["assignee"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_1 = + match node.["assets"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> Attachment.jsonParse elt) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assets" + || key = "assignee" + || key = "assignees" + || key = "body" + || key = "closed_at" + || key = "comments" + || key = "created_at" + || key = "due_date" + || key = "html_url" + || key = "id" + || key = "is_locked" + || key = "labels" + || key = "milestone" + || key = "number" + || key = "original_author" + || key = "original_author_id" + || key = "pull_request" + || key = "ref" + || key = "repository" + || key = "state" + || key = "title" + || key = "updated_at" + || key = "url" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assets = arg_1 + Assignee = arg_2 + Assignees = arg_3 + Body = arg_4 + ClosedAt = arg_5 + Comments = arg_6 + CreatedAt = arg_7 + DueDate = arg_8 + HtmlUrl = arg_9 + Id = arg_10 + IsLocked = arg_11 + Labels = arg_12 + Milestone = arg_13 + Number = arg_14 + OriginalAuthor = arg_15 + OriginalAuthorId = arg_16 + PullRequest = arg_17 + Ref = arg_18 + Repository = arg_19 + State = arg_20 + Title = arg_21 + UpdatedAt = arg_22 + Url = arg_23 + User = arg_24 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NodeInfo type +[] +module NodeInfoJsonParseExtension = + /// Extension methods for JSON parsing + type NodeInfo with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NodeInfo = + let arg_7 = + match node.["version"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["usage"] with + | null -> None + | v -> NodeInfoUsage.jsonParse v |> Some + + let arg_5 = + match node.["software"] with + | null -> None + | v -> NodeInfoSoftware.jsonParse v |> Some + + let arg_4 = + match node.["services"] with + | null -> None + | v -> NodeInfoServices.jsonParse v |> Some + + let arg_3 = + match node.["protocols"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_2 = + match node.["openRegistrations"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["metadata"] with + | null -> None + | v -> Type7.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "metadata" + || key = "openRegistrations" + || key = "protocols" + || key = "services" + || key = "software" + || key = "usage" + || key = "version" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Metadata = arg_1 + OpenRegistrations = arg_2 + Protocols = arg_3 + Services = arg_4 + Software = arg_5 + Usage = arg_6 + Version = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Note type +[] +module NoteJsonParseExtension = + /// Extension methods for JSON parsing + type Note with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Note = + let arg_2 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["commit"] with + | null -> None + | v -> Commit.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "commit" || key = "message" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Commit = arg_1 + Message = arg_2 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the NotificationThread type +[] +module NotificationThreadJsonParseExtension = + /// Extension methods for JSON parsing + type NotificationThread with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : NotificationThread = + let arg_7 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["unread"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["subject"] with + | null -> None + | v -> NotificationSubject.jsonParse v |> Some + + let arg_3 = + match node.["repository"] with + | null -> None + | v -> Repository.jsonParse v |> Some + + let arg_2 = + match node.["pinned"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "id" + || key = "pinned" + || key = "repository" + || key = "subject" + || key = "unread" + || key = "updated_at" + || key = "url" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Id = arg_1 + Pinned = arg_2 + Repository = arg_3 + Subject = arg_4 + Unread = arg_5 + UpdatedAt = arg_6 + Url = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PRBranchInfo type +[] +module PRBranchInfoJsonParseExtension = + /// Extension methods for JSON parsing + type PRBranchInfo with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PRBranchInfo = + let arg_5 = + match node.["sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["repo_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["repo"] with + | null -> None + | v -> Repository.jsonParse v |> Some + + let arg_2 = + match node.["ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["label"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if key = "label" || key = "ref" || key = "repo" || key = "repo_id" || key = "sha" then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Label = arg_1 + Ref = arg_2 + Repo = arg_3 + RepoId = arg_4 + Sha = arg_5 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Package type +[] +module PackageJsonParseExtension = + /// Extension methods for JSON parsing + type Package with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Package = + let arg_8 = + match node.["version"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["repository"] with + | null -> None + | v -> Repository.jsonParse v |> Some + + let arg_5 = + match node.["owner"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_4 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["creator"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_1 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created_at" + || key = "creator" + || key = "id" + || key = "name" + || key = "owner" + || key = "repository" + || key = "type" + || key = "version" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + CreatedAt = arg_1 + Creator = arg_2 + Id = arg_3 + Name = arg_4 + Owner = arg_5 + Repository = arg_6 + Type = arg_7 + Version = arg_8 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PayloadCommit type +[] +module PayloadCommitJsonParseExtension = + /// Extension methods for JSON parsing + type PayloadCommit with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PayloadCommit = + let arg_10 = + match node.["verification"] with + | null -> None + | v -> PayloadCommitVerification.jsonParse v |> Some + + let arg_9 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["timestamp"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["removed"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_6 = + match node.["modified"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_5 = + match node.["message"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["committer"] with + | null -> None + | v -> PayloadUser.jsonParse v |> Some + + let arg_2 = + match node.["author"] with + | null -> None + | v -> PayloadUser.jsonParse v |> Some + + let arg_1 = + match node.["added"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "added" + || key = "author" + || key = "committer" + || key = "id" + || key = "message" + || key = "modified" + || key = "removed" + || key = "timestamp" + || key = "url" + || key = "verification" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Added = arg_1 + Author = arg_2 + Committer = arg_3 + Id = arg_4 + Message = arg_5 + Modified = arg_6 + Removed = arg_7 + Timestamp = arg_8 + Url = arg_9 + Verification = arg_10 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the PullRequest type +[] +module PullRequestJsonParseExtension = + /// Extension methods for JSON parsing + type PullRequest with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : PullRequest = + let arg_29 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_28 = + match node.["url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_27 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_26 = + match node.["title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_25 = + match node.["state"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_24 = + match node.["patch_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_23 = + match node.["number"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_22 = + match node.["milestone"] with + | null -> None + | v -> Milestone.jsonParse v |> Some + + let arg_21 = + match node.["merged_by"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_20 = + match node.["merged_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_19 = + match node.["merged"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["mergeable"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["merge_commit_sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + match node.["merge_base"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_15 = + match node.["labels"] with + | null -> None + | v -> v.AsArray () |> Seq.map (fun elt -> Label.jsonParse elt) |> List.ofSeq |> Some + + let arg_14 = + match node.["is_locked"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_12 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["head"] with + | null -> None + | v -> PRBranchInfo.jsonParse v |> Some + + let arg_10 = + match node.["due_date"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_9 = + match node.["diff_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["comments"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["closed_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["base"] with + | null -> None + | v -> PRBranchInfo.jsonParse v |> Some + + let arg_3 = + match node.["assignees"] with + | null -> None + | v -> v.AsArray () |> Seq.map (fun elt -> User.jsonParse elt) |> List.ofSeq |> Some + + let arg_2 = + match node.["assignee"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_1 = + match node.["allow_maintainer_edit"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "allow_maintainer_edit" + || key = "assignee" + || key = "assignees" + || key = "base" + || key = "body" + || key = "closed_at" + || key = "comments" + || key = "created_at" + || key = "diff_url" + || key = "due_date" + || key = "head" + || key = "html_url" + || key = "id" + || key = "is_locked" + || key = "labels" + || key = "merge_base" + || key = "merge_commit_sha" + || key = "mergeable" + || key = "merged" + || key = "merged_at" + || key = "merged_by" + || key = "milestone" + || key = "number" + || key = "patch_url" + || key = "state" + || key = "title" + || key = "updated_at" + || key = "url" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + AllowMaintainerEdit = arg_1 + Assignee = arg_2 + Assignees = arg_3 + Base = arg_4 + Body = arg_5 + ClosedAt = arg_6 + Comments = arg_7 + CreatedAt = arg_8 + DiffUrl = arg_9 + DueDate = arg_10 + Head = arg_11 + HtmlUrl = arg_12 + Id = arg_13 + IsLocked = arg_14 + Labels = arg_15 + MergeBase = arg_16 + MergeCommitSha = arg_17 + Mergeable = arg_18 + Merged = arg_19 + MergedAt = arg_20 + MergedBy = arg_21 + Milestone = arg_22 + Number = arg_23 + PatchUrl = arg_24 + State = arg_25 + Title = arg_26 + UpdatedAt = arg_27 + Url = arg_28 + User = arg_29 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the TrackedTime type +[] +module TrackedTimeJsonParseExtension = + /// Extension methods for JSON parsing + type TrackedTime with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : TrackedTime = + let arg_7 = + match node.["user_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["user_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["time"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["issue_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["issue"] with + | null -> None + | v -> Issue.jsonParse v |> Some + + let arg_2 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["created"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "created" + || key = "id" + || key = "issue" + || key = "issue_id" + || key = "time" + || key = "user_id" + || key = "user_name" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Created = arg_1 + Id = arg_2 + Issue = arg_3 + IssueId = arg_4 + Time = arg_5 + UserId = arg_6 + UserName = arg_7 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the Branch type +[] +module BranchJsonParseExtension = + /// Extension methods for JSON parsing + type Branch with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : Branch = + let arg_9 = + match node.["user_can_push"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_8 = + match node.["user_can_merge"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["status_check_contexts"] with + | null -> None + | v -> + v.AsArray () + |> Seq.map (fun elt -> elt.AsValue().GetValue ()) + |> List.ofSeq + |> Some + + let arg_6 = + match node.["required_approvals"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["protected"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_4 = + match node.["name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["enable_status_check"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["effective_branch_protection_name"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_1 = + match node.["commit"] with + | null -> None + | v -> PayloadCommit.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "commit" + || key = "effective_branch_protection_name" + || key = "enable_status_check" + || key = "name" + || key = "protected" + || key = "required_approvals" + || key = "status_check_contexts" + || key = "user_can_merge" + || key = "user_can_push" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Commit = arg_1 + EffectiveBranchProtectionName = arg_2 + EnableStatusCheck = arg_3 + Name = arg_4 + Protected = arg_5 + RequiredApprovals = arg_6 + StatusCheckContexts = arg_7 + UserCanMerge = arg_8 + UserCanPush = arg_9 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the TimelineComment type +[] +module TimelineCommentJsonParseExtension = + /// Extension methods for JSON parsing + type TimelineComment with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : TimelineComment = + let arg_29 = + match node.["user"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_28 = + match node.["updated_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_27 = + match node.["type"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_26 = + match node.["tracked_time"] with + | null -> None + | v -> TrackedTime.jsonParse v |> Some + + let arg_25 = + match node.["review_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_24 = + match node.["resolve_doer"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_23 = + match node.["removed_assignee"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_22 = + match node.["ref_issue"] with + | null -> None + | v -> Issue.jsonParse v |> Some + + let arg_21 = + match node.["ref_commit_sha"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_20 = + match node.["ref_comment"] with + | null -> None + | v -> Comment.jsonParse v |> Some + + let arg_19 = + match node.["ref_action"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_18 = + match node.["pull_request_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_17 = + match node.["project_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_16 = + match node.["old_title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_15 = + match node.["old_ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_14 = + match node.["old_project_id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_13 = + match node.["old_milestone"] with + | null -> None + | v -> Milestone.jsonParse v |> Some + + let arg_12 = + match node.["new_title"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_11 = + match node.["new_ref"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_10 = + match node.["milestone"] with + | null -> None + | v -> Milestone.jsonParse v |> Some + + let arg_9 = + match node.["label"] with + | null -> None + | v -> Label.jsonParse v |> Some + + let arg_8 = + match node.["issue_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_7 = + match node.["id"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_6 = + match node.["html_url"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_5 = + match node.["dependent_issue"] with + | null -> None + | v -> Issue.jsonParse v |> Some + + let arg_4 = + match node.["created_at"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_3 = + match node.["body"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some + + let arg_2 = + match node.["assignee_team"] with + | null -> None + | v -> Team.jsonParse v |> Some + + let arg_1 = + match node.["assignee"] with + | null -> None + | v -> User.jsonParse v |> Some + + let arg_0 = + let result = + System.Collections.Generic.Dictionary () + + let node = node.AsObject () + + for KeyValue (key, value) in node do + if + key = "assignee" + || key = "assignee_team" + || key = "body" + || key = "created_at" + || key = "dependent_issue" + || key = "html_url" + || key = "id" + || key = "issue_url" + || key = "label" + || key = "milestone" + || key = "new_ref" + || key = "new_title" + || key = "old_milestone" + || key = "old_project_id" + || key = "old_ref" + || key = "old_title" + || key = "project_id" + || key = "pull_request_url" + || key = "ref_action" + || key = "ref_comment" + || key = "ref_commit_sha" + || key = "ref_issue" + || key = "removed_assignee" + || key = "resolve_doer" + || key = "review_id" + || key = "tracked_time" + || key = "type" + || key = "updated_at" + || key = "user" + then + () + else + result.Add (key, node.[key]) + + result + + { + AdditionalProperties = arg_0 + Assignee = arg_1 + AssigneeTeam = arg_2 + Body = arg_3 + CreatedAt = arg_4 + DependentIssue = arg_5 + HtmlUrl = arg_6 + Id = arg_7 + IssueUrl = arg_8 + Label = arg_9 + Milestone = arg_10 + NewRef = arg_11 + NewTitle = arg_12 + OldMilestone = arg_13 + OldProjectId = arg_14 + OldRef = arg_15 + OldTitle = arg_16 + ProjectId = arg_17 + PullRequestUrl = arg_18 + RefAction = arg_19 + RefComment = arg_20 + RefCommitSha = arg_21 + RefIssue = arg_22 + RemovedAssignee = arg_23 + ResolveDoer = arg_24 + ReviewId = arg_25 + TrackedTime = arg_26 + Type = arg_27 + UpdatedAt = arg_28 + User = arg_29 + } +namespace Gitea + +/// Module containing JSON parsing extension members for the LanguageStatistics type +[] +module LanguageStatisticsJsonParseExtension = + /// Extension methods for JSON parsing + type LanguageStatistics with + + /// Parse from a JSON node. + static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : LanguageStatistics = + let arg_0 = + let result = System.Collections.Generic.Dictionary () + let node = node.AsObject () + + for KeyValue (key, value) in node do + if false then + () + else + result.Add ( + key, + (match node.[key] with + | null -> + raise ( + System.Collections.Generic.KeyNotFoundException ( + sprintf "Required key '%s' not found on JSON object" (key) + ) + ) + | v -> v) + .AsValue() + .GetValue () + ) + + result + + { + AdditionalProperties = arg_0 + } diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/WoofWare.Whippet.Plugin.Swagger.Consumer.fsproj b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/WoofWare.Whippet.Plugin.Swagger.Consumer.fsproj new file mode 100644 index 0000000..c76ef27 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/WoofWare.Whippet.Plugin.Swagger.Consumer.fsproj @@ -0,0 +1,38 @@ + + + + net8.0 + true + false + + + + + + + + + + + + + + + + + + swagger-gitea.json + Gitea + + + GeneratedSwaggerGitea.fs + InterfaceMock + + + GeneratedSwaggerGitea.fs + HttpClient + JsonParseGenerator,JsonSerializeGenerator + + + + diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/swagger-gitea.json b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/swagger-gitea.json new file mode 100644 index 0000000..e1aefa2 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger.Consumer/swagger-gitea.json @@ -0,0 +1,21054 @@ +{ + "consumes": [ + "application/json", + "text/plain" + ], + "produces": [ + "application/json", + "text/html" + ], + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "description": "This documentation describes the Gitea API.", + "title": "Gitea API.", + "license": { + "name": "MIT", + "url": "http://opensource.org/licenses/MIT" + }, + "version": "1.19.0" + }, + "basePath": "/api/v1", + "paths": { + "/activitypub/user/{username}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "activitypub" + ], + "summary": "Returns the Person actor for a user", + "operationId": "activitypubPerson", + "parameters": [ + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActivityPub" + } + } + } + }, + "/activitypub/user/{username}/inbox": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "activitypub" + ], + "summary": "Send to the inbox", + "operationId": "activitypubPersonInbox", + "parameters": [ + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, + "/admin/cron": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "List cron tasks", + "operationId": "adminCronList", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CronList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/admin/cron/{task}": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Run cron task", + "operationId": "adminCronRun", + "parameters": [ + { + "type": "string", + "description": "task to run", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/admin/hooks": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "List system's webhooks", + "operationId": "adminListHooks", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/HookList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Create a hook", + "operationId": "adminCreateHook", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateHookOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Hook" + } + } + } + }, + "/admin/hooks/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get a hook", + "operationId": "adminGetHook", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the hook to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Hook" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Update a hook", + "operationId": "adminEditHook", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the hook to update", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditHookOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Hook" + } + } + } + }, + "/admin/orgs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "List all organizations", + "operationId": "adminGetAllOrgs", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/OrganizationList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/admin/unadopted": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "List unadopted repositories", + "operationId": "adminUnadoptedList", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "pattern of repositories to search for", + "name": "pattern", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/StringSlice" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/admin/unadopted/{owner}/{repo}": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Adopt unadopted files as a repository", + "operationId": "adminAdoptRepository", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete unadopted files", + "operationId": "adminDeleteUnadoptedRepository", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/admin/users": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "List all users", + "operationId": "adminGetAllUsers", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Create a user", + "operationId": "adminCreateUser", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateUserOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/User" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/admin/users/{username}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete a user", + "operationId": "adminDeleteUser", + "parameters": [ + { + "type": "string", + "description": "username of user to delete", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "purge the user from the system completely", + "name": "purge", + "in": "query" + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Edit an existing user", + "operationId": "adminEditUser", + "parameters": [ + { + "type": "string", + "description": "username of user to edit", + "name": "username", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditUserOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/User" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/admin/users/{username}/keys": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Add a public key on behalf of a user", + "operationId": "adminCreatePublicKey", + "parameters": [ + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + }, + { + "name": "key", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateKeyOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/PublicKey" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/admin/users/{username}/keys/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete a user's public key", + "operationId": "adminDeleteUserPublicKey", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the key to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/admin/users/{username}/orgs": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Create an organization", + "operationId": "adminCreateOrg", + "parameters": [ + { + "type": "string", + "description": "username of the user that will own the created organization", + "name": "username", + "in": "path", + "required": true + }, + { + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrgOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Organization" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/admin/users/{username}/repos": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Create a repository on behalf of a user", + "operationId": "adminCreateRepo", + "parameters": [ + { + "type": "string", + "description": "username of the user. This user will own the created repository", + "name": "username", + "in": "path", + "required": true + }, + { + "name": "repository", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRepoOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Repository" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/amdin/hooks/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete a hook", + "operationId": "adminDeleteHook", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the hook to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, + "/markdown": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "text/html" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Render a markdown document as HTML", + "operationId": "renderMarkdown", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/MarkdownOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/MarkdownRender" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/markdown/raw": { + "post": { + "consumes": [ + "text/plain" + ], + "produces": [ + "text/html" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Render raw markdown as HTML", + "operationId": "renderMarkdownRaw", + "parameters": [ + { + "description": "Request body to render", + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/MarkdownRender" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/nodeinfo": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Returns the nodeinfo of the Gitea application", + "operationId": "getNodeInfo", + "responses": { + "200": { + "$ref": "#/responses/NodeInfo" + } + } + } + }, + "/notifications": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "notification" + ], + "summary": "List users's notification threads", + "operationId": "notifyGetList", + "parameters": [ + { + "type": "boolean", + "description": "If true, show notifications marked as read. Default value is false", + "name": "all", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned.", + "name": "status-types", + "in": "query" + }, + { + "type": "array", + "items": { + "enum": [ + "issue", + "pull", + "commit", + "repository" + ], + "type": "string" + }, + "collectionFormat": "multi", + "description": "filter notifications by subject type", + "name": "subject-type", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show notifications updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/NotificationThreadList" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "notification" + ], + "summary": "Mark notification threads as read, pinned or unread", + "operationId": "notifyReadList", + "parameters": [ + { + "type": "string", + "format": "date-time", + "description": "Describes the last point that notifications were checked. Anything updated since this time will not be updated.", + "name": "last_read_at", + "in": "query" + }, + { + "type": "string", + "description": "If true, mark all notifications on this repo. Default value is false", + "name": "all", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.", + "name": "status-types", + "in": "query" + }, + { + "type": "string", + "description": "Status to mark notifications as, Defaults to read.", + "name": "to-status", + "in": "query" + } + ], + "responses": { + "205": { + "$ref": "#/responses/NotificationThreadList" + } + } + } + }, + "/notifications/new": { + "get": { + "tags": [ + "notification" + ], + "summary": "Check if unread notifications exist", + "operationId": "notifyNewAvailable", + "responses": { + "200": { + "$ref": "#/responses/NotificationCount" + } + } + } + }, + "/notifications/threads/{id}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "notification" + ], + "summary": "Get notification thread by ID", + "operationId": "notifyGetThread", + "parameters": [ + { + "type": "string", + "description": "id of notification thread", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/NotificationThread" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "notification" + ], + "summary": "Mark notification thread as read by ID", + "operationId": "notifyReadThread", + "parameters": [ + { + "type": "string", + "description": "id of notification thread", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "default": "read", + "description": "Status to mark notifications as", + "name": "to-status", + "in": "query" + } + ], + "responses": { + "205": { + "$ref": "#/responses/NotificationThread" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/org/{org}/repos": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Create a repository in an organization", + "operationId": "createOrgRepoDeprecated", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "name of organization", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateRepoOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/orgs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get list of organizations", + "operationId": "orgGetAll", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/OrganizationList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Create an organization", + "operationId": "orgCreate", + "parameters": [ + { + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrgOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Organization" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/orgs/{org}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get an organization", + "operationId": "orgGet", + "parameters": [ + { + "type": "string", + "description": "name of the organization to get", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Organization" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Delete an organization", + "operationId": "orgDelete", + "parameters": [ + { + "type": "string", + "description": "organization that is to be deleted", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Edit an organization", + "operationId": "orgEdit", + "parameters": [ + { + "type": "string", + "description": "name of the organization to edit", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EditOrgOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Organization" + } + } + } + }, + "/orgs/{org}/hooks": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List an organization's webhooks", + "operationId": "orgListHooks", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/HookList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Create a hook", + "operationId": "orgCreateHook", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateHookOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Hook" + } + } + } + }, + "/orgs/{org}/hooks/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get a hook", + "operationId": "orgGetHook", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the hook to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Hook" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Delete a hook", + "operationId": "orgDeleteHook", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the hook to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Update a hook", + "operationId": "orgEditHook", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the hook to update", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditHookOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Hook" + } + } + } + }, + "/orgs/{org}/labels": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List an organization's labels", + "operationId": "orgListLabels", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/LabelList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Create a label for an organization", + "operationId": "orgCreateLabel", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateLabelOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Label" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/orgs/{org}/labels/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get a single label", + "operationId": "orgGetLabel", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Label" + } + } + }, + "delete": { + "tags": [ + "organization" + ], + "summary": "Delete a label", + "operationId": "orgDeleteLabel", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Update a label", + "operationId": "orgEditLabel", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditLabelOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Label" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/orgs/{org}/members": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List an organization's members", + "operationId": "orgListMembers", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/orgs/{org}/members/{username}": { + "get": { + "tags": [ + "organization" + ], + "summary": "Check if a user is a member of an organization", + "operationId": "orgIsMember", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "user is a member" + }, + "303": { + "description": "redirection to /orgs/{org}/public_members/{username}" + }, + "404": { + "description": "user is not a member" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Remove a member from an organization", + "operationId": "orgDeleteMember", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "member removed" + } + } + } + }, + "/orgs/{org}/public_members": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List an organization's public members", + "operationId": "orgListPublicMembers", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/orgs/{org}/public_members/{username}": { + "get": { + "tags": [ + "organization" + ], + "summary": "Check if a user is a public member of an organization", + "operationId": "orgIsPublicMember", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "user is a public member" + }, + "404": { + "description": "user is not a public member" + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Publicize a user's membership", + "operationId": "orgPublicizeMember", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "membership publicized" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Conceal a user's membership", + "operationId": "orgConcealMember", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/orgs/{org}/repos": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List an organization's repos", + "operationId": "orgListRepos", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Create a repository in an organization", + "operationId": "createOrgRepo", + "parameters": [ + { + "type": "string", + "description": "name of organization", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateRepoOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Repository" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/orgs/{org}/teams": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List an organization's teams", + "operationId": "orgListTeams", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TeamList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Create a team", + "operationId": "orgCreateTeam", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateTeamOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Team" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/orgs/{org}/teams/search": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Search for teams within an organization", + "operationId": "teamSearch", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "keywords to search", + "name": "q", + "in": "query" + }, + { + "type": "boolean", + "description": "include search within team description (defaults to true)", + "name": "include_desc", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "SearchResults of a successful search", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Team" + } + }, + "ok": { + "type": "boolean" + } + } + } + } + } + } + }, + "/packages/{owner}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets all packages of an owner", + "operationId": "listPackages", + "parameters": [ + { + "type": "string", + "description": "owner of the packages", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + }, + { + "enum": [ + "cargo", + "chef", + "composer", + "conan", + "conda", + "container", + "generic", + "helm", + "maven", + "npm", + "nuget", + "pub", + "pypi", + "rubygems", + "vagrant" + ], + "type": "string", + "description": "package type filter", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "name filter", + "name": "q", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PackageList" + } + } + } + }, + "/packages/{owner}/{type}/{name}/{version}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets a package", + "operationId": "getPackage", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "version of the package", + "name": "version", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Package" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "tags": [ + "package" + ], + "summary": "Delete a package", + "operationId": "deletePackage", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "version of the package", + "name": "version", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/packages/{owner}/{type}/{name}/{version}/files": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets all files of a package", + "operationId": "listPackageFiles", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "version of the package", + "name": "version", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PackageFileList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/issues/search": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Search for issues across the repositories that the user has access to", + "operationId": "issueSearchIssues", + "parameters": [ + { + "type": "string", + "description": "whether issue is open or closed", + "name": "state", + "in": "query" + }, + { + "type": "string", + "description": "comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded", + "name": "labels", + "in": "query" + }, + { + "type": "string", + "description": "comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded", + "name": "milestones", + "in": "query" + }, + { + "type": "string", + "description": "search string", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "repository to prioritize in the results", + "name": "priority_repo_id", + "in": "query" + }, + { + "type": "string", + "description": "filter by type (issues / pulls) if set", + "name": "type", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show notifications updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + }, + { + "type": "boolean", + "description": "filter (issues / pulls) assigned to you, default is false", + "name": "assigned", + "in": "query" + }, + { + "type": "boolean", + "description": "filter (issues / pulls) created by you, default is false", + "name": "created", + "in": "query" + }, + { + "type": "boolean", + "description": "filter (issues / pulls) mentioning you, default is false", + "name": "mentioned", + "in": "query" + }, + { + "type": "boolean", + "description": "filter pulls requesting your review, default is false", + "name": "review_requested", + "in": "query" + }, + { + "type": "string", + "description": "filter by owner", + "name": "owner", + "in": "query" + }, + { + "type": "string", + "description": "filter by team (requires organization owner parameter to be provided)", + "name": "team", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/IssueList" + } + } + } + }, + "/repos/migrate": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Migrate a remote git repository", + "operationId": "repoMigrate", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/MigrateRepoOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "409": { + "description": "The repository with the same name already exists." + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/search": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Search for repositories", + "operationId": "repoSearch", + "parameters": [ + { + "type": "string", + "description": "keyword", + "name": "q", + "in": "query" + }, + { + "type": "boolean", + "description": "Limit search to repositories with keyword as topic", + "name": "topic", + "in": "query" + }, + { + "type": "boolean", + "description": "include search of keyword within repository description", + "name": "includeDesc", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "search only for repos that the user with the given id owns or contributes to", + "name": "uid", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "repo owner to prioritize in the results", + "name": "priority_owner_id", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "search only for repos that belong to the given team id", + "name": "team_id", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "search only for repos that the user with the given id has starred", + "name": "starredBy", + "in": "query" + }, + { + "type": "boolean", + "description": "include private repositories this user has access to (defaults to true)", + "name": "private", + "in": "query" + }, + { + "type": "boolean", + "description": "show only pubic, private or all repositories (defaults to all)", + "name": "is_private", + "in": "query" + }, + { + "type": "boolean", + "description": "include template repositories this user has access to (defaults to true)", + "name": "template", + "in": "query" + }, + { + "type": "boolean", + "description": "show only archived, non-archived or all repositories (defaults to all)", + "name": "archived", + "in": "query" + }, + { + "type": "string", + "description": "type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\"", + "name": "mode", + "in": "query" + }, + { + "type": "boolean", + "description": "if `uid` is given, search only for repos that the user owns", + "name": "exclusive", + "in": "query" + }, + { + "type": "string", + "description": "sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\"", + "name": "sort", + "in": "query" + }, + { + "type": "string", + "description": "sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified.", + "name": "order", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/SearchResults" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a repository", + "operationId": "repoGet", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Repository" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a repository", + "operationId": "repoDelete", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to delete", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to delete", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Edit a repository's properties. Only fields that are set will be changed.", + "operationId": "repoEdit", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to edit", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to edit", + "name": "repo", + "in": "path", + "required": true + }, + { + "description": "Properties of a repo that you can edit", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditRepoOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/archive/{archive}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get an archive of a repository", + "operationId": "repoGetArchive", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "the git reference for download with attached archive format (e.g. master.zip)", + "name": "archive", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/assignees": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Return all users that have write access and can be assigned to issues", + "operationId": "repoGetAssignees", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/repos/{owner}/{repo}/branch_protections": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List branch protections for a repository", + "operationId": "repoListBranchProtection", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/BranchProtectionList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a branch protections for a repository", + "operationId": "repoCreateBranchProtection", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateBranchProtectionOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/BranchProtection" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/branch_protections/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a specific branch protection for the repository", + "operationId": "repoGetBranchProtection", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of protected branch", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/BranchProtection" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a specific branch protection for the repository", + "operationId": "repoDeleteBranchProtection", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of protected branch", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Edit a branch protections for a repository. Only fields that are set will be changed", + "operationId": "repoEditBranchProtection", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of protected branch", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditBranchProtectionOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/BranchProtection" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/branches": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's branches", + "operationId": "repoListBranches", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/BranchList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a branch", + "operationId": "repoCreateBranch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateBranchRepoOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Branch" + }, + "404": { + "description": "The old branch does not exist." + }, + "409": { + "description": "The branch with the same name already exists." + } + } + } + }, + "/repos/{owner}/{repo}/branches/{branch}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Retrieve a specific branch from a repository, including its effective branch protection", + "operationId": "repoGetBranch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "branch to get", + "name": "branch", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Branch" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a specific branch from a repository", + "operationId": "repoDeleteBranch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "branch to delete", + "name": "branch", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/collaborators": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's collaborators", + "operationId": "repoListCollaborators", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/repos/{owner}/{repo}/collaborators/{collaborator}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Check if a user is a collaborator of a repository", + "operationId": "repoCheckCollaborator", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the collaborator", + "name": "collaborator", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Add a collaborator to a repository", + "operationId": "repoAddCollaborator", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the collaborator to add", + "name": "collaborator", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AddCollaboratorOption" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a collaborator from a repository", + "operationId": "repoDeleteCollaborator", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the collaborator to delete", + "name": "collaborator", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/collaborators/{collaborator}/permission": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get repository permissions for a user", + "operationId": "repoGetRepoPermissions", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the collaborator", + "name": "collaborator", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepoCollaboratorPermission" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/commits": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a list of all commits from a repository", + "operationId": "repoGetAllCommits", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "SHA or branch to start listing commits from (usually 'master')", + "name": "sha", + "in": "query" + }, + { + "type": "string", + "description": "filepath of a file/dir", + "name": "path", + "in": "query" + }, + { + "type": "boolean", + "description": "include diff stats for every commit (disable for speedup, default 'true')", + "name": "stat", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results (ignored if used with 'path')", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CommitList" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "$ref": "#/responses/EmptyRepository" + } + } + } + }, + "/repos/{owner}/{repo}/commits/{ref}/status": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a commit's combined status, by branch/tag/commit reference", + "operationId": "repoGetCombinedStatusByRef", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of branch/tag/commit", + "name": "ref", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CombinedStatus" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/commits/{ref}/statuses": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a commit's statuses, by branch/tag/commit reference", + "operationId": "repoListStatusesByRef", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of branch/tag/commit", + "name": "ref", + "in": "path", + "required": true + }, + { + "enum": [ + "oldest", + "recentupdate", + "leastupdate", + "leastindex", + "highestindex" + ], + "type": "string", + "description": "type of sort", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "pending", + "success", + "error", + "failure", + "warning" + ], + "type": "string", + "description": "type of state", + "name": "state", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CommitStatusList" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/contents": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the metadata of all the entries of the root dir", + "operationId": "repoGetContentsList", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsListResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/contents/{filepath}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir", + "operationId": "repoGetContents", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "path of the dir, file, symlink or submodule in the repo", + "name": "filepath", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Update a file in a repository", + "operationId": "repoUpdateFile", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "path of the file to update", + "name": "filepath", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateFileOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/FileResponse" + }, + "403": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a file in a repository", + "operationId": "repoCreateFile", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "path of the file to create", + "name": "filepath", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateFileOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/FileResponse" + }, + "403": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a file in a repository", + "operationId": "repoDeleteFile", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "path of the file to delete", + "name": "filepath", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteFileOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/FileDeleteResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/diffpatch": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Apply diff patch to repository", + "operationId": "repoApplyDiffPatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateFileOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/FileResponse" + } + } + } + }, + "/repos/{owner}/{repo}/editorconfig/{filepath}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get the EditorConfig definitions of a file in a repository", + "operationId": "repoGetEditorConfig", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filepath of file to get", + "name": "filepath", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/forks": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's forks", + "operationId": "listForks", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Fork a repository", + "operationId": "createFork", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to fork", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to fork", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateForkOption" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "409": { + "description": "The repository with the same name already exists." + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/git/blobs/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the blob of a repository.", + "operationId": "GetBlob", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sha of the commit", + "name": "sha", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/GitBlobResponse" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/git/commits/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a single commit from a repository", + "operationId": "repoGetSingleCommit", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "a git ref or commit sha", + "name": "sha", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Commit" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/git/commits/{sha}.{diffType}": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "repository" + ], + "summary": "Get a commit's diff or patch", + "operationId": "repoDownloadCommitDiffOrPatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "SHA of the commit to get", + "name": "sha", + "in": "path", + "required": true + }, + { + "enum": [ + "diff", + "patch" + ], + "type": "string", + "description": "whether the output is diff or patch", + "name": "diffType", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/string" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/git/notes/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a note corresponding to a single commit from a repository", + "operationId": "repoGetNote", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "a git ref or commit sha", + "name": "sha", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Note" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/git/refs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get specified ref or filtered repository's refs", + "operationId": "repoListAllGitRefs", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ReferenceList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/git/refs/{ref}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get specified ref or filtered repository's refs", + "operationId": "repoListGitRefs", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "part or full name of the ref", + "name": "ref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ReferenceList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/git/tags/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the tag object of an annotated tag (not lightweight tags)", + "operationId": "GetAnnotatedTag", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags.", + "name": "sha", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/AnnotatedTag" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/git/trees/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the tree of a repository.", + "operationId": "GetTree", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sha of the commit", + "name": "sha", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "show all directories and files", + "name": "recursive", + "in": "query" + }, + { + "type": "integer", + "description": "page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "number of items per page", + "name": "per_page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/GitTreeResponse" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/hooks": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List the hooks in a repository", + "operationId": "repoListHooks", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/HookList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a hook", + "operationId": "repoCreateHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateHookOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Hook" + } + } + } + }, + "/repos/{owner}/{repo}/hooks/git": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List the Git hooks in a repository", + "operationId": "repoListGitHooks", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/GitHookList" + } + } + } + }, + "/repos/{owner}/{repo}/hooks/git/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a Git hook", + "operationId": "repoGetGitHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the hook to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/GitHook" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a Git hook in a repository", + "operationId": "repoDeleteGitHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the hook to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Edit a Git hook in a repository", + "operationId": "repoEditGitHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the hook to get", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditGitHookOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/GitHook" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/hooks/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a hook", + "operationId": "repoGetHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the hook to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Hook" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a hook in a repository", + "operationId": "repoDeleteHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the hook to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Edit a hook in a repository", + "operationId": "repoEditHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the hook", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditHookOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Hook" + } + } + } + }, + "/repos/{owner}/{repo}/hooks/{id}/tests": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Test a push webhook", + "operationId": "repoTestHook", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the hook to test", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag, indicates which commit will be loaded to the webhook payload.", + "name": "ref", + "in": "query" + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, + "/repos/{owner}/{repo}/issue_templates": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get available issue templates for a repository", + "operationId": "repoGetIssueTemplates", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/IssueTemplates" + } + } + } + }, + "/repos/{owner}/{repo}/issues": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List a repository's issues", + "operationId": "issueListIssues", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "enum": [ + "closed", + "open", + "all" + ], + "type": "string", + "description": "whether issue is open or closed", + "name": "state", + "in": "query" + }, + { + "type": "string", + "description": "comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded", + "name": "labels", + "in": "query" + }, + { + "type": "string", + "description": "search string", + "name": "q", + "in": "query" + }, + { + "enum": [ + "issues", + "pulls" + ], + "type": "string", + "description": "filter by type (issues / pulls) if set", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "comma separated list of milestone names or ids. It uses names and fall back to ids. Fetch only issues that have any of this milestones. Non existent milestones are discarded", + "name": "milestones", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show items updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show items updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + }, + { + "type": "string", + "description": "Only show items which were created by the the given user", + "name": "created_by", + "in": "query" + }, + { + "type": "string", + "description": "Only show items for which the given user is assigned", + "name": "assigned_by", + "in": "query" + }, + { + "type": "string", + "description": "Only show items in which the given user was mentioned", + "name": "mentioned_by", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/IssueList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Create an issue. If using deadline only the date will be taken into account, and time of day ignored.", + "operationId": "issueCreateIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateIssueOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Issue" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "412": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List all comments in a repository", + "operationId": "issueGetRepoComments", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "if provided, only comments updated since the provided time are returned.", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "if provided, only comments updated before the provided time are returned.", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CommentList" + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments/{id}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get a comment", + "operationId": "issueGetComment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Comment" + }, + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "tags": [ + "issue" + ], + "summary": "Delete a comment", + "operationId": "issueDeleteComment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of comment to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Edit a comment", + "operationId": "issueEditComment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditIssueCommentOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Comment" + }, + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments/{id}/assets": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List comment's attachments", + "operationId": "issueListIssueCommentAttachments", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/AttachmentList" + }, + "404": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Create a comment attachment", + "operationId": "issueCreateIssueCommentAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the attachment", + "name": "name", + "in": "query" + }, + { + "type": "file", + "description": "attachment to upload", + "name": "attachment", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/Attachment" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get a comment attachment", + "operationId": "issueGetIssueCommentAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to get", + "name": "attachment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Attachment" + }, + "404": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Delete a comment attachment", + "operationId": "issueDeleteIssueCommentAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to delete", + "name": "attachment_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Edit a comment attachment", + "operationId": "issueEditIssueCommentAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to edit", + "name": "attachment_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditAttachmentOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Attachment" + }, + "404": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments/{id}/reactions": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get a list of reactions from a comment of an issue", + "operationId": "issueGetCommentReactions", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment to edit", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ReactionList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Add a reaction to a comment of an issue", + "operationId": "issuePostCommentReaction", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "content", + "in": "body", + "schema": { + "$ref": "#/definitions/EditReactionOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Reaction" + }, + "201": { + "$ref": "#/responses/Reaction" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Remove a reaction from a comment of an issue", + "operationId": "issueDeleteCommentReaction", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "content", + "in": "body", + "schema": { + "$ref": "#/definitions/EditReactionOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get an issue", + "operationId": "issueGetIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to get", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Issue" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "tags": [ + "issue" + ], + "summary": "Delete an issue", + "operationId": "issueDelete", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of issue to delete", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Edit an issue. If using deadline only the date will be taken into account, and time of day ignored.", + "operationId": "issueEditIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to edit", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditIssueOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Issue" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "412": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/assets": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List issue's attachments", + "operationId": "issueListIssueAttachments", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/AttachmentList" + }, + "404": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Create an issue attachment", + "operationId": "issueCreateIssueAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the attachment", + "name": "name", + "in": "query" + }, + { + "type": "file", + "description": "attachment to upload", + "name": "attachment", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/Attachment" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get an issue attachment", + "operationId": "issueGetIssueAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to get", + "name": "attachment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Attachment" + }, + "404": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Delete an issue attachment", + "operationId": "issueDeleteIssueAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to delete", + "name": "attachment_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Edit an issue attachment", + "operationId": "issueEditIssueAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to edit", + "name": "attachment_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditAttachmentOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Attachment" + }, + "404": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/comments": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List all comments on an issue", + "operationId": "issueGetComments", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "if provided, only comments updated since the specified time are returned.", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "if provided, only comments updated before the provided time are returned.", + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CommentList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Add a comment to an issue", + "operationId": "issueCreateComment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateIssueCommentOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Comment" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/comments/{id}": { + "delete": { + "tags": [ + "issue" + ], + "summary": "Delete a comment", + "operationId": "issueDeleteCommentDeprecated", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "this parameter is ignored", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of comment to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Edit a comment", + "operationId": "issueEditCommentDeprecated", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "this parameter is ignored", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the comment to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditIssueCommentOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Comment" + }, + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/deadline": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored.", + "operationId": "issueEditIssueDeadline", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to create or update a deadline on", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditDeadlineOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/IssueDeadline" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/labels": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get an issue's labels", + "operationId": "issueGetLabels", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/LabelList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Replace an issue's labels", + "operationId": "issueReplaceLabels", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/IssueLabelsOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/LabelList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Add a label to an issue", + "operationId": "issueAddLabel", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/IssueLabelsOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/LabelList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Remove all labels from an issue", + "operationId": "issueClearLabels", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/labels/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Remove a label from an issue", + "operationId": "issueRemoveLabel", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to remove", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/reactions": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get a list reactions of an issue", + "operationId": "issueGetIssueReactions", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ReactionList" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Add a reaction to an issue", + "operationId": "issuePostIssueReaction", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "content", + "in": "body", + "schema": { + "$ref": "#/definitions/EditReactionOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Reaction" + }, + "201": { + "$ref": "#/responses/Reaction" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Remove a reaction from an issue", + "operationId": "issueDeleteIssueReaction", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "content", + "in": "body", + "schema": { + "$ref": "#/definitions/EditReactionOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/stopwatch/delete": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Delete an issue's existing stopwatch.", + "operationId": "issueDeleteStopWatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to stop the stopwatch on", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "description": "Not repo writer, user does not have rights to toggle stopwatch" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "description": "Cannot cancel a non existent stopwatch" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/stopwatch/start": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Start stopwatch on an issue.", + "operationId": "issueStartStopWatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to create the stopwatch on", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/empty" + }, + "403": { + "description": "Not repo writer, user does not have rights to toggle stopwatch" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "description": "Cannot start a stopwatch again if it already exists" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/stopwatch/stop": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Stop an issue's existing stopwatch.", + "operationId": "issueStopStopWatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to stop the stopwatch on", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/empty" + }, + "403": { + "description": "Not repo writer, user does not have rights to toggle stopwatch" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "description": "Cannot stop a non existent stopwatch" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/subscriptions": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get users who subscribed on an issue.", + "operationId": "issueSubscriptions", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/subscriptions/check": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Check if user is subscribed to an issue", + "operationId": "issueCheckSubscription", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/WatchInfo" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Subscribe user to issue", + "operationId": "issueAddSubscription", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "user to subscribe", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Already subscribed" + }, + "201": { + "description": "Successfully Subscribed" + }, + "304": { + "description": "User can only subscribe itself if he is no admin" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Unsubscribe user from issue", + "operationId": "issueDeleteSubscription", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "user witch unsubscribe", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Already unsubscribed" + }, + "201": { + "description": "Successfully Unsubscribed" + }, + "304": { + "description": "User can only subscribe itself if he is no admin" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/timeline": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List all comments and events on an issue", + "operationId": "issueGetCommentsAndTimeline", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "if provided, only comments updated since the specified time are returned.", + "name": "since", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "if provided, only comments updated before the provided time are returned.", + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TimelineList" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/times": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List an issue's tracked times", + "operationId": "issueTrackedTimes", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "optional filter by user (available for issue managers)", + "name": "user", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show times updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show times updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTimeList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Add tracked time to a issue", + "operationId": "issueAddTime", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AddTimeOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTime" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Reset a tracked time of an issue", + "operationId": "issueResetTime", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to add tracked time to", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/times/{id}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Delete specific tracked time", + "operationId": "issueDeleteTime", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of time to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/keys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's keys", + "operationId": "repoListKeys", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "the key_id to search for", + "name": "key_id", + "in": "query" + }, + { + "type": "string", + "description": "fingerprint of the key", + "name": "fingerprint", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/DeployKeyList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Add a key to a repository", + "operationId": "repoCreateKey", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateKeyOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/DeployKey" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/keys/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a repository's key by id", + "operationId": "repoGetKey", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the key to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/DeployKey" + } + } + }, + "delete": { + "tags": [ + "repository" + ], + "summary": "Delete a key from a repository", + "operationId": "repoDeleteKey", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the key to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/labels": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get all of a repository's labels", + "operationId": "issueListLabels", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/LabelList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Create a label", + "operationId": "issueCreateLabel", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateLabelOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Label" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/labels/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get a single label", + "operationId": "issueGetLabel", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Label" + } + } + }, + "delete": { + "tags": [ + "issue" + ], + "summary": "Delete a label", + "operationId": "issueDeleteLabel", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Update a label", + "operationId": "issueEditLabel", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the label to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditLabelOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Label" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/languages": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get languages and number of bytes of code written", + "operationId": "repoGetLanguages", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/LanguageStatistics" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/media/{filepath}": { + "get": { + "tags": [ + "repository" + ], + "summary": "Get a file or it's LFS object from a repository", + "operationId": "repoGetRawFileOrLFS", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filepath of the file to get", + "name": "filepath", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Returns raw file content." + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/milestones": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get all of a repository's opened milestones", + "operationId": "issueGetMilestonesList", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Milestone state, Recognized values are open, closed and all. Defaults to \"open\"", + "name": "state", + "in": "query" + }, + { + "type": "string", + "description": "filter by milestone name", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/MilestoneList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Create a milestone", + "operationId": "issueCreateMilestone", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMilestoneOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Milestone" + } + } + } + }, + "/repos/{owner}/{repo}/milestones/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Get a milestone", + "operationId": "issueGetMilestone", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "the milestone to get, identified by ID and if not available by name", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Milestone" + } + } + }, + "delete": { + "tags": [ + "issue" + ], + "summary": "Delete a milestone", + "operationId": "issueDeleteMilestone", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "the milestone to delete, identified by ID and if not available by name", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Update a milestone", + "operationId": "issueEditMilestone", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "the milestone to edit, identified by ID and if not available by name", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditMilestoneOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Milestone" + } + } + } + }, + "/repos/{owner}/{repo}/mirror-sync": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Sync a mirrored repository", + "operationId": "repoMirrorSync", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to sync", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to sync", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/notifications": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "notification" + ], + "summary": "List users's notification threads on a specific repo", + "operationId": "notifyGetRepoList", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "If true, show notifications marked as read. Default value is false", + "name": "all", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned", + "name": "status-types", + "in": "query" + }, + { + "type": "array", + "items": { + "enum": [ + "issue", + "pull", + "commit", + "repository" + ], + "type": "string" + }, + "collectionFormat": "multi", + "description": "filter notifications by subject type", + "name": "subject-type", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show notifications updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/NotificationThreadList" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "notification" + ], + "summary": "Mark notification threads as read, pinned or unread on a specific repo", + "operationId": "notifyReadRepoList", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "If true, mark all notifications on this repo. Default value is false", + "name": "all", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.", + "name": "status-types", + "in": "query" + }, + { + "type": "string", + "description": "Status to mark notifications as. Defaults to read.", + "name": "to-status", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Describes the last point that notifications were checked. Anything updated since this time will not be updated.", + "name": "last_read_at", + "in": "query" + } + ], + "responses": { + "205": { + "$ref": "#/responses/NotificationThreadList" + } + } + } + }, + "/repos/{owner}/{repo}/pulls": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repo's pull requests", + "operationId": "repoListPullRequests", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "enum": [ + "closed", + "open", + "all" + ], + "type": "string", + "description": "State of pull request: open or closed (optional)", + "name": "state", + "in": "query" + }, + { + "enum": [ + "oldest", + "recentupdate", + "leastupdate", + "mostcomment", + "leastcomment", + "priority" + ], + "type": "string", + "description": "Type of sort", + "name": "sort", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "ID of the milestone", + "name": "milestone", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "collectionFormat": "multi", + "description": "Label IDs", + "name": "labels", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullRequestList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a pull request", + "operationId": "repoCreatePullRequest", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreatePullRequestOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/PullRequest" + }, + "409": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a pull request", + "operationId": "repoGetPullRequest", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to get", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullRequest" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Update a pull request. If using deadline only the date will be taken into account, and time of day ignored.", + "operationId": "repoEditPullRequest", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to edit", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditPullRequestOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/PullRequest" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "409": { + "$ref": "#/responses/error" + }, + "412": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}.{diffType}": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "repository" + ], + "summary": "Get a pull request diff or patch", + "operationId": "repoDownloadPullDiffOrPatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to get", + "name": "index", + "in": "path", + "required": true + }, + { + "enum": [ + "diff", + "patch" + ], + "type": "string", + "description": "whether the output is diff or patch", + "name": "diffType", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to include binary file changes. if true, the diff is applicable with `git apply`", + "name": "binary", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/string" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/commits": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get commits for a pull request", + "operationId": "repoGetPullRequestCommits", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to get", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CommitList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/files": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get changed files for a pull request", + "operationId": "repoGetPullRequestFiles", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to get", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "skip to given file", + "name": "skip-to", + "in": "query" + }, + { + "enum": [ + "ignore-all", + "ignore-change", + "ignore-eol", + "show-all" + ], + "type": "string", + "description": "whitespace behavior", + "name": "whitespace", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ChangedFileList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/merge": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Check if a pull request has been merged", + "operationId": "repoPullRequestIsMerged", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "pull request has been merged" + }, + "404": { + "description": "pull request has not been merged" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Merge a pull request", + "operationId": "repoMergePullRequest", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to merge", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/MergePullRequestOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/empty" + }, + "405": { + "$ref": "#/responses/empty" + }, + "409": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Cancel the scheduled auto merge for the given pull request", + "operationId": "repoCancelScheduledAutoMerge", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to merge", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/requested_reviewers": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "create review requests for a pull request", + "operationId": "repoCreatePullReviewRequests", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PullReviewRequestOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/PullReviewList" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "cancel review requests for a pull request", + "operationId": "repoDeletePullReviewRequests", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PullReviewRequestOptions" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/reviews": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List all reviews for a pull request", + "operationId": "repoListPullReviews", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReviewList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a review to an pull request", + "operationId": "repoCreatePullReview", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreatePullReviewOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReview" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/reviews/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a specific review for a pull request", + "operationId": "repoGetPullReview", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the review", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReview" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Submit a pending review to an pull request", + "operationId": "repoSubmitPullReview", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the review", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SubmitPullReviewOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReview" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a specific review from a pull request", + "operationId": "repoDeletePullReview", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the review", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a specific review for a pull request", + "operationId": "repoGetPullReviewComments", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the review", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReviewCommentList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Dismiss a review for a pull request", + "operationId": "repoDismissPullReview", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the review", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DismissPullReviewOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReview" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Cancel to dismiss a review for a pull request", + "operationId": "repoUnDismissPullReview", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the review", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PullReview" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{index}/update": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Merge PR's baseBranch into headBranch", + "operationId": "repoUpdatePullRequest", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the pull request to get", + "name": "index", + "in": "path", + "required": true + }, + { + "enum": [ + "merge", + "rebase" + ], + "type": "string", + "description": "how to update pull request", + "name": "style", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/push_mirrors": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get all push mirrors of the repository", + "operationId": "repoListPushMirrors", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PushMirrorList" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "add a push mirror to the repository", + "operationId": "repoAddPushMirror", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreatePushMirrorOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/PushMirror" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/push_mirrors-sync": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Sync all push mirrored repository", + "operationId": "repoPushMirrorSync", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to sync", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to sync", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/empty" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/push_mirrors/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get push mirror of the repository by remoteName", + "operationId": "repoGetPushMirrorByRemoteName", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "remote name of push mirror", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PushMirror" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "deletes a push mirror from a repository by remoteName", + "operationId": "repoDeletePushMirror", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "remote name of the pushMirror", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/raw/{filepath}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a file from a repository", + "operationId": "repoGetRawFile", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filepath of the file to get", + "name": "filepath", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Returns raw file content." + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/releases": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repo's releases", + "operationId": "repoListReleases", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "filter (exclude / include) drafts, if you dont have repo write access none will show", + "name": "draft", + "in": "query" + }, + { + "type": "boolean", + "description": "filter (exclude / include) pre-releases", + "name": "pre-release", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results, deprecated - use limit", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ReleaseList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a release", + "operationId": "repoCreateRelease", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateReleaseOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Release" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/releases/latest": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at", + "operationId": "repoGetLatestRelease", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Release" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/releases/tags/{tag}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a release by tag name", + "operationId": "repoGetReleaseByTag", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "tag name of the release to get", + "name": "tag", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Release" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "tags": [ + "repository" + ], + "summary": "Delete a release by tag name", + "operationId": "repoDeleteReleaseByTag", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "tag name of the release to delete", + "name": "tag", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "405": { + "$ref": "#/responses/empty" + } + } + } + }, + "/repos/{owner}/{repo}/releases/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a release", + "operationId": "repoGetRelease", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Release" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "tags": [ + "repository" + ], + "summary": "Delete a release", + "operationId": "repoDeleteRelease", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "405": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Update a release", + "operationId": "repoEditRelease", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditReleaseOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Release" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/releases/{id}/assets": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List release's attachments", + "operationId": "repoListReleaseAttachments", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/AttachmentList" + } + } + }, + "post": { + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a release attachment", + "operationId": "repoCreateReleaseAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the attachment", + "name": "name", + "in": "query" + }, + { + "type": "file", + "description": "attachment to upload", + "name": "attachment", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/Attachment" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a release attachment", + "operationId": "repoGetReleaseAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to get", + "name": "attachment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Attachment" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a release attachment", + "operationId": "repoDeleteReleaseAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to delete", + "name": "attachment_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Edit a release attachment", + "operationId": "repoEditReleaseAttachment", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the release", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of the attachment to edit", + "name": "attachment_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditAttachmentOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Attachment" + } + } + } + }, + "/repos/{owner}/{repo}/reviewers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Return all users that can be requested to review in this repo", + "operationId": "repoGetReviewers", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/repos/{owner}/{repo}/signing-key.gpg": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "repository" + ], + "summary": "Get signing-key.gpg for given repository", + "operationId": "repoSigningKey", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "GPG armored public key", + "schema": { + "type": "string" + } + } + } + } + }, + "/repos/{owner}/{repo}/stargazers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repo's stargazers", + "operationId": "repoListStargazers", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/repos/{owner}/{repo}/statuses/{sha}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a commit's statuses", + "operationId": "repoListStatuses", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sha of the commit", + "name": "sha", + "in": "path", + "required": true + }, + { + "enum": [ + "oldest", + "recentupdate", + "leastupdate", + "leastindex", + "highestindex" + ], + "type": "string", + "description": "type of sort", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "pending", + "success", + "error", + "failure", + "warning" + ], + "type": "string", + "description": "type of state", + "name": "state", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CommitStatusList" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a commit status", + "operationId": "repoCreateStatus", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sha of the commit", + "name": "sha", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateStatusOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/CommitStatus" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/subscribers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repo's watchers", + "operationId": "repoListSubscribers", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/repos/{owner}/{repo}/subscription": { + "get": { + "tags": [ + "repository" + ], + "summary": "Check if the current user is watching a repo", + "operationId": "userCurrentCheckSubscription", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/WatchInfo" + }, + "404": { + "description": "User is not watching this repo or repo do not exist" + } + } + }, + "put": { + "tags": [ + "repository" + ], + "summary": "Watch a repo", + "operationId": "userCurrentPutSubscription", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/WatchInfo" + } + } + }, + "delete": { + "tags": [ + "repository" + ], + "summary": "Unwatch a repo", + "operationId": "userCurrentDeleteSubscription", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, + "/repos/{owner}/{repo}/tags": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's tags", + "operationId": "repoListTags", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results, default maximum page size is 50", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TagList" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a new git tag in a repository", + "operationId": "repoCreateTag", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateTagOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Tag" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "405": { + "$ref": "#/responses/empty" + }, + "409": { + "$ref": "#/responses/conflict" + } + } + } + }, + "/repos/{owner}/{repo}/tags/{tag}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get the tag of a repository by tag name", + "operationId": "repoGetTag", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of tag", + "name": "tag", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Tag" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a repository's tag by name", + "operationId": "repoDeleteTag", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of tag to delete", + "name": "tag", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "405": { + "$ref": "#/responses/empty" + }, + "409": { + "$ref": "#/responses/conflict" + } + } + } + }, + "/repos/{owner}/{repo}/teams": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's teams", + "operationId": "repoListTeams", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/TeamList" + } + } + } + }, + "/repos/{owner}/{repo}/teams/{team}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Check if a team is assigned to a repository", + "operationId": "repoCheckTeam", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "team name", + "name": "team", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "405": { + "$ref": "#/responses/error" + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Add a team to a repository", + "operationId": "repoAddTeam", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "team name", + "name": "team", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "405": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a team from a repository", + "operationId": "repoDeleteTeam", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "team name", + "name": "team", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "405": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/times": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repo's tracked times", + "operationId": "repoTrackedTimes", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "optional filter by user (available for issue managers)", + "name": "user", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show times updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show times updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTimeList" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/times/{user}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a user's tracked times in a repo", + "operationId": "userTrackedTimes", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of user", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTimeList" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/topics": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get list of topics that a repository has", + "operationId": "repoListTopics", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TopicNames" + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Replace list of topics for a repository", + "operationId": "repoUpdateTopics", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/RepoTopicOptions" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "422": { + "$ref": "#/responses/invalidTopicsError" + } + } + } + }, + "/repos/{owner}/{repo}/topics/{topic}": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Add a topic to a repository", + "operationId": "repoAddTopic", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the topic to add", + "name": "topic", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "422": { + "$ref": "#/responses/invalidTopicsError" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a topic from a repository", + "operationId": "repoDeleteTopic", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the topic to delete", + "name": "topic", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "422": { + "$ref": "#/responses/invalidTopicsError" + } + } + } + }, + "/repos/{owner}/{repo}/transfer": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Transfer a repo ownership", + "operationId": "repoTransfer", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to transfer", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to transfer", + "name": "repo", + "in": "path", + "required": true + }, + { + "description": "Transfer Options", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TransferRepoOption" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/transfer/accept": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Accept a repo transfer", + "operationId": "acceptRepoTransfer", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to transfer", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to transfer", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/transfer/reject": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Reject a repo transfer", + "operationId": "rejectRepoTransfer", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to transfer", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to transfer", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/wiki/new": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a wiki page", + "operationId": "repoCreateWikiPage", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateWikiPageOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/WikiPage" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/wiki/page/{pageName}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a wiki page", + "operationId": "repoGetWikiPage", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the page", + "name": "pageName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/WikiPage" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "tags": [ + "repository" + ], + "summary": "Delete a wiki page", + "operationId": "repoDeleteWikiPage", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the page", + "name": "pageName", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Edit a wiki page", + "operationId": "repoEditWikiPage", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the page", + "name": "pageName", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateWikiPageOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/WikiPage" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/repos/{owner}/{repo}/wiki/pages": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get all wiki pages", + "operationId": "repoGetWikiPages", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WikiPageList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/wiki/revisions/{pageName}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get revisions of a wiki page", + "operationId": "repoGetWikiPageRevisions", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the page", + "name": "pageName", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WikiCommitList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{template_owner}/{template_repo}/generate": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a repository using a template", + "operationId": "generateRepo", + "parameters": [ + { + "type": "string", + "description": "name of the template repository owner", + "name": "template_owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the template repository", + "name": "template_repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/GenerateRepoOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Repository" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "description": "The repository with the same name already exists." + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repositories/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a repository by id", + "operationId": "repoGetByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the repo to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Repository" + } + } + } + }, + "/settings/api": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "settings" + ], + "summary": "Get instance's global settings for api", + "operationId": "getGeneralAPISettings", + "responses": { + "200": { + "$ref": "#/responses/GeneralAPISettings" + } + } + } + }, + "/settings/attachment": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "settings" + ], + "summary": "Get instance's global settings for Attachment", + "operationId": "getGeneralAttachmentSettings", + "responses": { + "200": { + "$ref": "#/responses/GeneralAttachmentSettings" + } + } + } + }, + "/settings/repository": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "settings" + ], + "summary": "Get instance's global settings for repositories", + "operationId": "getGeneralRepositorySettings", + "responses": { + "200": { + "$ref": "#/responses/GeneralRepoSettings" + } + } + } + }, + "/settings/ui": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "settings" + ], + "summary": "Get instance's global settings for ui", + "operationId": "getGeneralUISettings", + "responses": { + "200": { + "$ref": "#/responses/GeneralUISettings" + } + } + } + }, + "/signing-key.gpg": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Get default signing-key.gpg", + "operationId": "getSigningKey", + "responses": { + "200": { + "description": "GPG armored public key", + "schema": { + "type": "string" + } + } + } + } + }, + "/teams/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get a team", + "operationId": "orgGetTeam", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + } + } + }, + "delete": { + "tags": [ + "organization" + ], + "summary": "Delete a team", + "operationId": "orgDeleteTeam", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "team deleted" + } + } + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Edit a team", + "operationId": "orgEditTeam", + "parameters": [ + { + "type": "integer", + "description": "id of the team to edit", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EditTeamOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + } + } + } + }, + "/teams/{id}/members": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List a team's members", + "operationId": "orgListTeamMembers", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/teams/{id}/members/{username}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List a particular member of team", + "operationId": "orgListTeamMember", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the member to list", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/User" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Add a team member", + "operationId": "orgAddTeamMember", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user to add", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Remove a team member", + "operationId": "orgRemoveTeamMember", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user to remove", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/teams/{id}/repos": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List a team's repos", + "operationId": "orgListTeamRepos", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + } + }, + "/teams/{id}/repos/{org}/{repo}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List a particular repo of team", + "operationId": "orgListTeamRepo", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "organization that owns the repo to list", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to list", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Repository" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Add a repository to a team", + "operationId": "orgAddTeamRepository", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "organization that owns the repo to add", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to add", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "description": "This does not delete the repository, it only removes the repository from the team.", + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Remove a repository from a team", + "operationId": "orgRemoveTeamRepository", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the team", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "organization that owns the repo to remove", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to remove", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/topics/search": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "search topics via keyword", + "operationId": "topicSearch", + "parameters": [ + { + "type": "string", + "description": "keywords to search", + "name": "q", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TopicListResponse" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + } + }, + "/user": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get the authenticated user", + "operationId": "userGetCurrent", + "responses": { + "200": { + "$ref": "#/responses/User" + } + } + } + }, + "/user/applications/oauth2": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the authenticated user's oauth2 applications", + "operationId": "userGetOauth2Application", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/OAuth2ApplicationList" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "creates a new OAuth2 application", + "operationId": "userCreateOAuth2Application", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOAuth2ApplicationOptions" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/OAuth2Application" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/user/applications/oauth2/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "get an OAuth2 Application", + "operationId": "userGetOAuth2Application", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Application ID to be found", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/OAuth2Application" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "delete an OAuth2 Application", + "operationId": "userDeleteOAuth2Application", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "token to be deleted", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "update an OAuth2 Application, this includes regenerating the client secret", + "operationId": "userUpdateOAuth2Application", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "application to be updated", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOAuth2ApplicationOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/OAuth2Application" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/emails": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the authenticated user's email addresses", + "operationId": "userListEmails", + "responses": { + "200": { + "$ref": "#/responses/EmailList" + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Add email addresses", + "operationId": "userAddEmail", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateEmailOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/EmailList" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete email addresses", + "operationId": "userDeleteEmail", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/DeleteEmailOption" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/followers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the authenticated user's followers", + "operationId": "userCurrentListFollowers", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/user/following": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the users that the authenticated user is following", + "operationId": "userCurrentListFollowing", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/user/following/{username}": { + "get": { + "tags": [ + "user" + ], + "summary": "Check whether a user is followed by the authenticated user", + "operationId": "userCurrentCheckFollowing", + "parameters": [ + { + "type": "string", + "description": "username of followed user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "put": { + "tags": [ + "user" + ], + "summary": "Follow a user", + "operationId": "userCurrentPutFollow", + "parameters": [ + { + "type": "string", + "description": "username of user to follow", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "delete": { + "tags": [ + "user" + ], + "summary": "Unfollow a user", + "operationId": "userCurrentDeleteFollow", + "parameters": [ + { + "type": "string", + "description": "username of user to unfollow", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, + "/user/gpg_key_token": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "user" + ], + "summary": "Get a Token to verify", + "operationId": "getVerificationToken", + "responses": { + "200": { + "$ref": "#/responses/string" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/gpg_key_verify": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Verify a GPG key", + "operationId": "userVerifyGPGKey", + "responses": { + "201": { + "$ref": "#/responses/GPGKey" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/user/gpg_keys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the authenticated user's GPG keys", + "operationId": "userCurrentListGPGKeys", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/GPGKeyList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Create a GPG key", + "operationId": "userCurrentPostGPGKey", + "parameters": [ + { + "name": "Form", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateGPGKeyOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/GPGKey" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/user/gpg_keys/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get a GPG key", + "operationId": "userCurrentGetGPGKey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of key to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/GPGKey" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Remove a GPG key", + "operationId": "userCurrentDeleteGPGKey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of key to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/keys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the authenticated user's public keys", + "operationId": "userCurrentListKeys", + "parameters": [ + { + "type": "string", + "description": "fingerprint of the key", + "name": "fingerprint", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PublicKeyList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Create a public key", + "operationId": "userCurrentPostKey", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateKeyOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/PublicKey" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/user/keys/{id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get a public key", + "operationId": "userCurrentGetKey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of key to get", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/PublicKey" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete a public key", + "operationId": "userCurrentDeleteKey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of key to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/orgs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List the current user's organizations", + "operationId": "orgListCurrentUserOrgs", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/OrganizationList" + } + } + } + }, + "/user/repos": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the repos that the authenticated user owns", + "operationId": "userCurrentListRepos", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "repository", + "user" + ], + "summary": "Create a repository", + "operationId": "createCurrentUserRepo", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateRepoOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/Repository" + }, + "400": { + "$ref": "#/responses/error" + }, + "409": { + "description": "The repository with the same name already exists." + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/user/settings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user settings", + "operationId": "getUserSettings", + "responses": { + "200": { + "$ref": "#/responses/UserSettings" + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update user settings", + "operationId": "updateUserSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UserSettingsOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserSettings" + } + } + } + }, + "/user/starred": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "The repos that the authenticated user has starred", + "operationId": "userCurrentListStarred", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + } + }, + "/user/starred/{owner}/{repo}": { + "get": { + "tags": [ + "user" + ], + "summary": "Whether the authenticated is starring the repo", + "operationId": "userCurrentCheckStarring", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "put": { + "tags": [ + "user" + ], + "summary": "Star the given repo", + "operationId": "userCurrentPutStar", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to star", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to star", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, + "delete": { + "tags": [ + "user" + ], + "summary": "Unstar the given repo", + "operationId": "userCurrentDeleteStar", + "parameters": [ + { + "type": "string", + "description": "owner of the repo to unstar", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo to unstar", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, + "/user/stopwatches": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get list of all existing stopwatches", + "operationId": "userGetStopWatches", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/StopWatchList" + } + } + } + }, + "/user/subscriptions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List repositories watched by the authenticated user", + "operationId": "userCurrentListSubscriptions", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + } + }, + "/user/teams": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List all the teams a user belongs to", + "operationId": "userListTeams", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TeamList" + } + } + } + }, + "/user/times": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the current user's tracked times", + "operationId": "userCurrentTrackedTimes", + "parameters": [ + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show times updated after the given time. This is a timestamp in RFC 3339 format", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only show times updated before the given time. This is a timestamp in RFC 3339 format", + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTimeList" + } + } + } + }, + "/users/search": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Search for users", + "operationId": "userSearch", + "parameters": [ + { + "type": "string", + "description": "keyword", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "ID of the user to search for", + "name": "uid", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "SearchResults of a successful search", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "ok": { + "type": "boolean" + } + } + } + } + } + } + }, + "/users/{username}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get a user", + "operationId": "userGet", + "parameters": [ + { + "type": "string", + "description": "username of user to get", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/User" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/users/{username}/followers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the given user's followers", + "operationId": "userListFollowers", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/users/{username}/following": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the users that the given user is following", + "operationId": "userListFollowing", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserList" + } + } + } + }, + "/users/{username}/following/{target}": { + "get": { + "tags": [ + "user" + ], + "summary": "Check if one user is following another user", + "operationId": "userCheckFollowing", + "parameters": [ + { + "type": "string", + "description": "username of following user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of followed user", + "name": "target", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/users/{username}/gpg_keys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the given user's GPG keys", + "operationId": "userListGPGKeys", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/GPGKeyList" + } + } + } + }, + "/users/{username}/heatmap": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get a user's heatmap", + "operationId": "userGetHeatmapData", + "parameters": [ + { + "type": "string", + "description": "username of user to get", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserHeatmapData" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/users/{username}/keys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the given user's public keys", + "operationId": "userListKeys", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fingerprint of the key", + "name": "fingerprint", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PublicKeyList" + } + } + } + }, + "/users/{username}/orgs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "List a user's organizations", + "operationId": "orgListUserOrgs", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/OrganizationList" + } + } + } + }, + "/users/{username}/orgs/{org}/permissions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get user permissions in organization", + "operationId": "orgGetUserPermissions", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/OrganizationPermissions" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/users/{username}/repos": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the repos owned by the given user", + "operationId": "userListRepos", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + } + }, + "/users/{username}/starred": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "The repos that the given user has starred", + "operationId": "userListStarred", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + } + }, + "/users/{username}/subscriptions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the repositories watched by a user", + "operationId": "userListSubscriptions", + "parameters": [ + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/RepositoryList" + } + } + } + }, + "/users/{username}/tokens": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "List the authenticated user's access tokens", + "operationId": "userGetTokens", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/AccessTokenList" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Create an access token", + "operationId": "userCreateToken", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateAccessTokenOption" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/AccessToken" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/users/{username}/tokens/{token}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "delete an access token", + "operationId": "userDeleteAccessToken", + "parameters": [ + { + "type": "string", + "description": "username of user", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "token to be deleted, identified by ID and if not available by name", + "name": "token", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/error" + } + } + } + }, + "/version": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Returns the version of the Gitea application", + "operationId": "getVersion", + "responses": { + "200": { + "$ref": "#/responses/ServerVersion" + } + } + } + } + }, + "definitions": { + "APIError": { + "description": "APIError is an api error with a message", + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "AccessToken": { + "type": "object", + "title": "AccessToken represents an API access token.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Scopes" + }, + "sha1": { + "type": "string", + "x-go-name": "Token" + }, + "token_last_eight": { + "type": "string", + "x-go-name": "TokenLastEight" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActivityPub": { + "description": "ActivityPub type", + "type": "object", + "properties": { + "@context": { + "type": "string", + "x-go-name": "Context" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "AddCollaboratorOption": { + "description": "AddCollaboratorOption options when adding a user as a collaborator of a repository", + "type": "object", + "properties": { + "permission": { + "type": "string", + "x-go-name": "Permission" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "AddTimeOption": { + "description": "AddTimeOption options for adding time to an issue", + "type": "object", + "required": [ + "time" + ], + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "time": { + "description": "time in seconds", + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "user_name": { + "description": "User who spent the time (optional)", + "type": "string", + "x-go-name": "User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "AnnotatedTag": { + "description": "AnnotatedTag represents an annotated tag", + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "object": { + "$ref": "#/definitions/AnnotatedTagObject" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "tag": { + "type": "string", + "x-go-name": "Tag" + }, + "tagger": { + "$ref": "#/definitions/CommitUser" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "verification": { + "$ref": "#/definitions/PayloadCommitVerification" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "AnnotatedTagObject": { + "description": "AnnotatedTagObject contains meta information of the tag object", + "type": "object", + "properties": { + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Attachment": { + "description": "Attachment a generic attachment", + "type": "object", + "properties": { + "browser_download_url": { + "type": "string", + "x-go-name": "DownloadURL" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "download_count": { + "type": "integer", + "format": "int64", + "x-go-name": "DownloadCount" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" + }, + "uuid": { + "type": "string", + "x-go-name": "UUID" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Branch": { + "description": "Branch represents a repository branch", + "type": "object", + "properties": { + "commit": { + "$ref": "#/definitions/PayloadCommit" + }, + "effective_branch_protection_name": { + "type": "string", + "x-go-name": "EffectiveBranchProtectionName" + }, + "enable_status_check": { + "type": "boolean", + "x-go-name": "EnableStatusCheck" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "protected": { + "type": "boolean", + "x-go-name": "Protected" + }, + "required_approvals": { + "type": "integer", + "format": "int64", + "x-go-name": "RequiredApprovals" + }, + "status_check_contexts": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "StatusCheckContexts" + }, + "user_can_merge": { + "type": "boolean", + "x-go-name": "UserCanMerge" + }, + "user_can_push": { + "type": "boolean", + "x-go-name": "UserCanPush" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "BranchProtection": { + "description": "BranchProtection represents a branch protection for a repository", + "type": "object", + "properties": { + "approvals_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ApprovalsWhitelistTeams" + }, + "approvals_whitelist_username": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ApprovalsWhitelistUsernames" + }, + "block_on_official_review_requests": { + "type": "boolean", + "x-go-name": "BlockOnOfficialReviewRequests" + }, + "block_on_outdated_branch": { + "type": "boolean", + "x-go-name": "BlockOnOutdatedBranch" + }, + "block_on_rejected_reviews": { + "type": "boolean", + "x-go-name": "BlockOnRejectedReviews" + }, + "branch_name": { + "description": "Deprecated: true", + "type": "string", + "x-go-name": "BranchName" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "dismiss_stale_approvals": { + "type": "boolean", + "x-go-name": "DismissStaleApprovals" + }, + "enable_approvals_whitelist": { + "type": "boolean", + "x-go-name": "EnableApprovalsWhitelist" + }, + "enable_merge_whitelist": { + "type": "boolean", + "x-go-name": "EnableMergeWhitelist" + }, + "enable_push": { + "type": "boolean", + "x-go-name": "EnablePush" + }, + "enable_push_whitelist": { + "type": "boolean", + "x-go-name": "EnablePushWhitelist" + }, + "enable_status_check": { + "type": "boolean", + "x-go-name": "EnableStatusCheck" + }, + "merge_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MergeWhitelistTeams" + }, + "merge_whitelist_usernames": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MergeWhitelistUsernames" + }, + "protected_file_patterns": { + "type": "string", + "x-go-name": "ProtectedFilePatterns" + }, + "push_whitelist_deploy_keys": { + "type": "boolean", + "x-go-name": "PushWhitelistDeployKeys" + }, + "push_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PushWhitelistTeams" + }, + "push_whitelist_usernames": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PushWhitelistUsernames" + }, + "require_signed_commits": { + "type": "boolean", + "x-go-name": "RequireSignedCommits" + }, + "required_approvals": { + "type": "integer", + "format": "int64", + "x-go-name": "RequiredApprovals" + }, + "rule_name": { + "type": "string", + "x-go-name": "RuleName" + }, + "status_check_contexts": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "StatusCheckContexts" + }, + "unprotected_file_patterns": { + "type": "string", + "x-go-name": "UnprotectedFilePatterns" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ChangedFile": { + "description": "ChangedFile store information about files affected by the pull request", + "type": "object", + "properties": { + "additions": { + "type": "integer", + "format": "int64", + "x-go-name": "Additions" + }, + "changes": { + "type": "integer", + "format": "int64", + "x-go-name": "Changes" + }, + "contents_url": { + "type": "string", + "x-go-name": "ContentsURL" + }, + "deletions": { + "type": "integer", + "format": "int64", + "x-go-name": "Deletions" + }, + "filename": { + "type": "string", + "x-go-name": "Filename" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "previous_filename": { + "type": "string", + "x-go-name": "PreviousFilename" + }, + "raw_url": { + "type": "string", + "x-go-name": "RawURL" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CombinedStatus": { + "description": "CombinedStatus holds the combined state of several statuses for a single commit", + "type": "object", + "properties": { + "commit_url": { + "type": "string", + "x-go-name": "CommitURL" + }, + "repository": { + "$ref": "#/definitions/Repository" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "state": { + "$ref": "#/definitions/CommitStatusState" + }, + "statuses": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitStatus" + }, + "x-go-name": "Statuses" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Comment": { + "description": "Comment represents a comment on a commit or issue", + "type": "object", + "properties": { + "assets": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + }, + "x-go-name": "Attachments" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "issue_url": { + "type": "string", + "x-go-name": "IssueURL" + }, + "original_author": { + "type": "string", + "x-go-name": "OriginalAuthor" + }, + "original_author_id": { + "type": "integer", + "format": "int64", + "x-go-name": "OriginalAuthorID" + }, + "pull_request_url": { + "type": "string", + "x-go-name": "PRURL" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Commit": { + "type": "object", + "title": "Commit contains information generated from a Git commit.", + "properties": { + "author": { + "$ref": "#/definitions/User" + }, + "commit": { + "$ref": "#/definitions/RepoCommit" + }, + "committer": { + "$ref": "#/definitions/User" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitAffectedFiles" + }, + "x-go-name": "Files" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "parents": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitMeta" + }, + "x-go-name": "Parents" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "stats": { + "$ref": "#/definitions/CommitStats" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitAffectedFiles": { + "description": "CommitAffectedFiles store information about files affected by the commit", + "type": "object", + "properties": { + "filename": { + "type": "string", + "x-go-name": "Filename" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitDateOptions": { + "description": "CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE", + "type": "object", + "properties": { + "author": { + "type": "string", + "format": "date-time", + "x-go-name": "Author" + }, + "committer": { + "type": "string", + "format": "date-time", + "x-go-name": "Committer" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitMeta": { + "type": "object", + "title": "CommitMeta contains meta information of a commit in terms of API.", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitStats": { + "description": "CommitStats is statistics for a RepoCommit", + "type": "object", + "properties": { + "additions": { + "type": "integer", + "format": "int64", + "x-go-name": "Additions" + }, + "deletions": { + "type": "integer", + "format": "int64", + "x-go-name": "Deletions" + }, + "total": { + "type": "integer", + "format": "int64", + "x-go-name": "Total" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitStatus": { + "description": "CommitStatus holds a single status of a single Commit", + "type": "object", + "properties": { + "context": { + "type": "string", + "x-go-name": "Context" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "creator": { + "$ref": "#/definitions/User" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "status": { + "$ref": "#/definitions/CommitStatusState" + }, + "target_url": { + "type": "string", + "x-go-name": "TargetURL" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitStatusState": { + "description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\"", + "type": "string", + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitUser": { + "type": "object", + "title": "CommitUser contains information of a user in the context of a commit.", + "properties": { + "date": { + "type": "string", + "x-go-name": "Date" + }, + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ContentsResponse": { + "description": "ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content", + "type": "object", + "properties": { + "_links": { + "$ref": "#/definitions/FileLinksResponse" + }, + "content": { + "description": "`content` is populated when `type` is `file`, otherwise null", + "type": "string", + "x-go-name": "Content" + }, + "download_url": { + "type": "string", + "x-go-name": "DownloadURL" + }, + "encoding": { + "description": "`encoding` is populated when `type` is `file`, otherwise null", + "type": "string", + "x-go-name": "Encoding" + }, + "git_url": { + "type": "string", + "x-go-name": "GitURL" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "last_commit_sha": { + "type": "string", + "x-go-name": "LastCommitSHA" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" + }, + "submodule_git_url": { + "description": "`submodule_git_url` is populated when `type` is `submodule`, otherwise null", + "type": "string", + "x-go-name": "SubmoduleGitURL" + }, + "target": { + "description": "`target` is populated when `type` is `symlink`, otherwise null", + "type": "string", + "x-go-name": "Target" + }, + "type": { + "description": "`type` will be `file`, `dir`, `symlink`, or `submodule`", + "type": "string", + "x-go-name": "Type" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateAccessTokenOption": { + "description": "CreateAccessTokenOption options when create access token", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Scopes" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateBranchProtectionOption": { + "description": "CreateBranchProtectionOption options for creating a branch protection", + "type": "object", + "properties": { + "approvals_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ApprovalsWhitelistTeams" + }, + "approvals_whitelist_username": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ApprovalsWhitelistUsernames" + }, + "block_on_official_review_requests": { + "type": "boolean", + "x-go-name": "BlockOnOfficialReviewRequests" + }, + "block_on_outdated_branch": { + "type": "boolean", + "x-go-name": "BlockOnOutdatedBranch" + }, + "block_on_rejected_reviews": { + "type": "boolean", + "x-go-name": "BlockOnRejectedReviews" + }, + "branch_name": { + "description": "Deprecated: true", + "type": "string", + "x-go-name": "BranchName" + }, + "dismiss_stale_approvals": { + "type": "boolean", + "x-go-name": "DismissStaleApprovals" + }, + "enable_approvals_whitelist": { + "type": "boolean", + "x-go-name": "EnableApprovalsWhitelist" + }, + "enable_merge_whitelist": { + "type": "boolean", + "x-go-name": "EnableMergeWhitelist" + }, + "enable_push": { + "type": "boolean", + "x-go-name": "EnablePush" + }, + "enable_push_whitelist": { + "type": "boolean", + "x-go-name": "EnablePushWhitelist" + }, + "enable_status_check": { + "type": "boolean", + "x-go-name": "EnableStatusCheck" + }, + "merge_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MergeWhitelistTeams" + }, + "merge_whitelist_usernames": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MergeWhitelistUsernames" + }, + "protected_file_patterns": { + "type": "string", + "x-go-name": "ProtectedFilePatterns" + }, + "push_whitelist_deploy_keys": { + "type": "boolean", + "x-go-name": "PushWhitelistDeployKeys" + }, + "push_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PushWhitelistTeams" + }, + "push_whitelist_usernames": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PushWhitelistUsernames" + }, + "require_signed_commits": { + "type": "boolean", + "x-go-name": "RequireSignedCommits" + }, + "required_approvals": { + "type": "integer", + "format": "int64", + "x-go-name": "RequiredApprovals" + }, + "rule_name": { + "type": "string", + "x-go-name": "RuleName" + }, + "status_check_contexts": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "StatusCheckContexts" + }, + "unprotected_file_patterns": { + "type": "string", + "x-go-name": "UnprotectedFilePatterns" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateBranchRepoOption": { + "description": "CreateBranchRepoOption options when creating a branch in a repository", + "type": "object", + "required": [ + "new_branch_name" + ], + "properties": { + "new_branch_name": { + "description": "Name of the branch to create", + "type": "string", + "uniqueItems": true, + "x-go-name": "BranchName" + }, + "old_branch_name": { + "description": "Name of the old branch to create from", + "type": "string", + "uniqueItems": true, + "x-go-name": "OldBranchName" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateEmailOption": { + "description": "CreateEmailOption options when creating email addresses", + "type": "object", + "properties": { + "emails": { + "description": "email addresses to add", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Emails" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateFileOptions": { + "description": "CreateFileOptions options for creating files\nNote: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)", + "type": "object", + "required": [ + "content" + ], + "properties": { + "author": { + "$ref": "#/definitions/Identity" + }, + "branch": { + "description": "branch (optional) to base this file from. if not given, the default branch is used", + "type": "string", + "x-go-name": "BranchName" + }, + "committer": { + "$ref": "#/definitions/Identity" + }, + "content": { + "description": "content must be base64 encoded", + "type": "string", + "x-go-name": "Content" + }, + "dates": { + "$ref": "#/definitions/CommitDateOptions" + }, + "message": { + "description": "message (optional) for the commit of this file. if not supplied, a default message will be used", + "type": "string", + "x-go-name": "Message" + }, + "new_branch": { + "description": "new_branch (optional) will make a new branch from `branch` before creating the file", + "type": "string", + "x-go-name": "NewBranchName" + }, + "signoff": { + "description": "Add a Signed-off-by trailer by the committer at the end of the commit log message.", + "type": "boolean", + "x-go-name": "Signoff" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateForkOption": { + "description": "CreateForkOption options for creating a fork", + "type": "object", + "properties": { + "name": { + "description": "name of the forked repository", + "type": "string", + "x-go-name": "Name" + }, + "organization": { + "description": "organization name, if forking into an organization", + "type": "string", + "x-go-name": "Organization" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateGPGKeyOption": { + "description": "CreateGPGKeyOption options create user GPG key", + "type": "object", + "required": [ + "armored_public_key" + ], + "properties": { + "armored_public_key": { + "description": "An armored GPG key to add", + "type": "string", + "uniqueItems": true, + "x-go-name": "ArmoredKey" + }, + "armored_signature": { + "type": "string", + "x-go-name": "Signature" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateHookOption": { + "description": "CreateHookOption options when create a hook", + "type": "object", + "required": [ + "type", + "config" + ], + "properties": { + "active": { + "type": "boolean", + "default": false, + "x-go-name": "Active" + }, + "authorization_header": { + "type": "string", + "x-go-name": "AuthorizationHeader" + }, + "branch_filter": { + "type": "string", + "x-go-name": "BranchFilter" + }, + "config": { + "$ref": "#/definitions/CreateHookOptionConfig" + }, + "events": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Events" + }, + "type": { + "type": "string", + "enum": [ + "dingtalk", + "discord", + "gitea", + "gogs", + "msteams", + "slack", + "telegram", + "feishu", + "wechatwork", + "packagist" + ], + "x-go-name": "Type" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateHookOptionConfig": { + "description": "CreateHookOptionConfig has all config options in it\nrequired are \"content_type\" and \"url\" Required", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateIssueCommentOption": { + "description": "CreateIssueCommentOption options for creating a comment on an issue", + "type": "object", + "required": [ + "body" + ], + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateIssueOption": { + "description": "CreateIssueOption options to create one issue", + "type": "object", + "required": [ + "title" + ], + "properties": { + "assignee": { + "description": "deprecated", + "type": "string", + "x-go-name": "Assignee" + }, + "assignees": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Assignees" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "closed": { + "type": "boolean", + "x-go-name": "Closed" + }, + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "labels": { + "description": "list of label ids", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "Labels" + }, + "milestone": { + "description": "milestone id", + "type": "integer", + "format": "int64", + "x-go-name": "Milestone" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateKeyOption": { + "description": "CreateKeyOption options when creating a key", + "type": "object", + "required": [ + "title", + "key" + ], + "properties": { + "key": { + "description": "An armored SSH key to add", + "type": "string", + "uniqueItems": true, + "x-go-name": "Key" + }, + "read_only": { + "description": "Describe if the key has only read access or read/write", + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "title": { + "description": "Title of the key to add", + "type": "string", + "uniqueItems": true, + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateLabelOption": { + "description": "CreateLabelOption options for creating a label", + "type": "object", + "required": [ + "name", + "color" + ], + "properties": { + "color": { + "type": "string", + "x-go-name": "Color", + "example": "#00aabb" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "exclusive": { + "type": "boolean", + "x-go-name": "Exclusive", + "example": false + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateMilestoneOption": { + "description": "CreateMilestoneOption options for creating a milestone", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "due_on": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "state": { + "type": "string", + "enum": [ + "open", + "closed" + ], + "x-go-name": "State" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateOAuth2ApplicationOptions": { + "description": "CreateOAuth2ApplicationOptions holds options to create an oauth2 application", + "type": "object", + "properties": { + "confidential_client": { + "type": "boolean", + "x-go-name": "ConfidentialClient" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "RedirectURIs" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateOrgOption": { + "description": "CreateOrgOption options for creating an organization", + "type": "object", + "required": [ + "username" + ], + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "repo_admin_change_team_access": { + "type": "boolean", + "x-go-name": "RepoAdminChangeTeamAccess" + }, + "username": { + "type": "string", + "x-go-name": "UserName" + }, + "visibility": { + "description": "possible values are `public` (default), `limited` or `private`", + "type": "string", + "enum": [ + "public", + "limited", + "private" + ], + "x-go-name": "Visibility" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreatePullRequestOption": { + "description": "CreatePullRequestOption options when creating a pull request", + "type": "object", + "properties": { + "assignee": { + "type": "string", + "x-go-name": "Assignee" + }, + "assignees": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Assignees" + }, + "base": { + "type": "string", + "x-go-name": "Base" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "head": { + "type": "string", + "x-go-name": "Head" + }, + "labels": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "Labels" + }, + "milestone": { + "type": "integer", + "format": "int64", + "x-go-name": "Milestone" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreatePullReviewComment": { + "description": "CreatePullReviewComment represent a review comment for creation api", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + }, + "new_position": { + "description": "if comment to new file line or 0", + "type": "integer", + "format": "int64", + "x-go-name": "NewLineNum" + }, + "old_position": { + "description": "if comment to old file line or 0", + "type": "integer", + "format": "int64", + "x-go-name": "OldLineNum" + }, + "path": { + "description": "the tree path", + "type": "string", + "x-go-name": "Path" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreatePullReviewOptions": { + "description": "CreatePullReviewOptions are options to create a pull review", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/CreatePullReviewComment" + }, + "x-go-name": "Comments" + }, + "commit_id": { + "type": "string", + "x-go-name": "CommitID" + }, + "event": { + "$ref": "#/definitions/ReviewStateType" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreatePushMirrorOption": { + "type": "object", + "title": "CreatePushMirrorOption represents need information to create a push mirror of a repository.", + "properties": { + "interval": { + "type": "string", + "x-go-name": "Interval" + }, + "remote_address": { + "type": "string", + "x-go-name": "RemoteAddress" + }, + "remote_password": { + "type": "string", + "x-go-name": "RemotePassword" + }, + "remote_username": { + "type": "string", + "x-go-name": "RemoteUsername" + }, + "sync_on_commit": { + "type": "boolean", + "x-go-name": "SyncOnCommit" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateReleaseOption": { + "description": "CreateReleaseOption options when creating a release", + "type": "object", + "required": [ + "tag_name" + ], + "properties": { + "body": { + "type": "string", + "x-go-name": "Note" + }, + "draft": { + "type": "boolean", + "x-go-name": "IsDraft" + }, + "name": { + "type": "string", + "x-go-name": "Title" + }, + "prerelease": { + "type": "boolean", + "x-go-name": "IsPrerelease" + }, + "tag_name": { + "type": "string", + "x-go-name": "TagName" + }, + "target_commitish": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateRepoOption": { + "description": "CreateRepoOption options when creating repository", + "type": "object", + "required": [ + "name" + ], + "properties": { + "auto_init": { + "description": "Whether the repository should be auto-initialized?", + "type": "boolean", + "x-go-name": "AutoInit" + }, + "default_branch": { + "description": "DefaultBranch of the repository (used when initializes and in template)", + "type": "string", + "x-go-name": "DefaultBranch" + }, + "description": { + "description": "Description of the repository to create", + "type": "string", + "x-go-name": "Description" + }, + "gitignores": { + "description": "Gitignores to use", + "type": "string", + "x-go-name": "Gitignores" + }, + "issue_labels": { + "description": "Label-Set to use", + "type": "string", + "x-go-name": "IssueLabels" + }, + "license": { + "description": "License to use", + "type": "string", + "x-go-name": "License" + }, + "name": { + "description": "Name of the repository to create", + "type": "string", + "uniqueItems": true, + "x-go-name": "Name" + }, + "private": { + "description": "Whether the repository is private", + "type": "boolean", + "x-go-name": "Private" + }, + "readme": { + "description": "Readme of the repository to create", + "type": "string", + "x-go-name": "Readme" + }, + "template": { + "description": "Whether the repository is template", + "type": "boolean", + "x-go-name": "Template" + }, + "trust_model": { + "description": "TrustModel of the repository", + "type": "string", + "enum": [ + "default", + "collaborator", + "committer", + "collaboratorcommitter" + ], + "x-go-name": "TrustModel" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateStatusOption": { + "description": "CreateStatusOption holds the information needed to create a new CommitStatus for a Commit", + "type": "object", + "properties": { + "context": { + "type": "string", + "x-go-name": "Context" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "state": { + "$ref": "#/definitions/CommitStatusState" + }, + "target_url": { + "type": "string", + "x-go-name": "TargetURL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateTagOption": { + "description": "CreateTagOption options when creating a tag", + "type": "object", + "required": [ + "tag_name" + ], + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "tag_name": { + "type": "string", + "x-go-name": "TagName" + }, + "target": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateTeamOption": { + "description": "CreateTeamOption options for creating a team", + "type": "object", + "required": [ + "name" + ], + "properties": { + "can_create_org_repo": { + "type": "boolean", + "x-go-name": "CanCreateOrgRepo" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "includes_all_repositories": { + "type": "boolean", + "x-go-name": "IncludesAllRepositories" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permission": { + "type": "string", + "enum": [ + "read", + "write", + "admin" + ], + "x-go-name": "Permission" + }, + "units": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Units", + "example": [ + "repo.code", + "repo.issues", + "repo.ext_issues", + "repo.wiki", + "repo.pulls", + "repo.releases", + "repo.projects", + "repo.ext_wiki" + ] + }, + "units_map": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "UnitsMap", + "example": { + "repo.code": "read", + "repo.ext_issues": "none", + "repo.ext_wiki": "none", + "repo.issues": "write", + "repo.projects": "none", + "repo.pulls": "owner", + "repo.releases": "none", + "repo.wiki": "admin" + } + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateUserOption": { + "description": "CreateUserOption create user options", + "type": "object", + "required": [ + "username", + "email", + "password" + ], + "properties": { + "created_at": { + "description": "For explicitly setting the user creation timestamp. Useful when users are\nmigrated from other systems. When omitted, the user's creation timestamp\nwill be set to \"now\".", + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "login_name": { + "type": "string", + "x-go-name": "LoginName" + }, + "must_change_password": { + "type": "boolean", + "x-go-name": "MustChangePassword" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "restricted": { + "type": "boolean", + "x-go-name": "Restricted" + }, + "send_notify": { + "type": "boolean", + "x-go-name": "SendNotify" + }, + "source_id": { + "type": "integer", + "format": "int64", + "x-go-name": "SourceID" + }, + "username": { + "type": "string", + "x-go-name": "Username" + }, + "visibility": { + "type": "string", + "x-go-name": "Visibility" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateWikiPageOptions": { + "description": "CreateWikiPageOptions form for creating wiki", + "type": "object", + "properties": { + "content_base64": { + "description": "content must be base64 encoded", + "type": "string", + "x-go-name": "ContentBase64" + }, + "message": { + "description": "optional commit message summarizing the change", + "type": "string", + "x-go-name": "Message" + }, + "title": { + "description": "page title. leave empty to keep unchanged", + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Cron": { + "description": "Cron represents a Cron task", + "type": "object", + "properties": { + "exec_times": { + "type": "integer", + "format": "int64", + "x-go-name": "ExecTimes" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "next": { + "type": "string", + "format": "date-time", + "x-go-name": "Next" + }, + "prev": { + "type": "string", + "format": "date-time", + "x-go-name": "Prev" + }, + "schedule": { + "type": "string", + "x-go-name": "Schedule" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "DeleteEmailOption": { + "description": "DeleteEmailOption options when deleting email addresses", + "type": "object", + "properties": { + "emails": { + "description": "email addresses to delete", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Emails" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "DeleteFileOptions": { + "description": "DeleteFileOptions options for deleting files (used for other File structs below)\nNote: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)", + "type": "object", + "required": [ + "sha" + ], + "properties": { + "author": { + "$ref": "#/definitions/Identity" + }, + "branch": { + "description": "branch (optional) to base this file from. if not given, the default branch is used", + "type": "string", + "x-go-name": "BranchName" + }, + "committer": { + "$ref": "#/definitions/Identity" + }, + "dates": { + "$ref": "#/definitions/CommitDateOptions" + }, + "message": { + "description": "message (optional) for the commit of this file. if not supplied, a default message will be used", + "type": "string", + "x-go-name": "Message" + }, + "new_branch": { + "description": "new_branch (optional) will make a new branch from `branch` before creating the file", + "type": "string", + "x-go-name": "NewBranchName" + }, + "sha": { + "description": "sha is the SHA for the file that already exists", + "type": "string", + "x-go-name": "SHA" + }, + "signoff": { + "description": "Add a Signed-off-by trailer by the committer at the end of the commit log message.", + "type": "boolean", + "x-go-name": "Signoff" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "DeployKey": { + "description": "DeployKey a deploy key", + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "fingerprint": { + "type": "string", + "x-go-name": "Fingerprint" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "key_id": { + "type": "integer", + "format": "int64", + "x-go-name": "KeyID" + }, + "read_only": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "repository": { + "$ref": "#/definitions/Repository" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "DismissPullReviewOptions": { + "description": "DismissPullReviewOptions are options to dismiss a pull review", + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "priors": { + "type": "boolean", + "x-go-name": "Priors" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditAttachmentOptions": { + "description": "EditAttachmentOptions options for editing attachments", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditBranchProtectionOption": { + "description": "EditBranchProtectionOption options for editing a branch protection", + "type": "object", + "properties": { + "approvals_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ApprovalsWhitelistTeams" + }, + "approvals_whitelist_username": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ApprovalsWhitelistUsernames" + }, + "block_on_official_review_requests": { + "type": "boolean", + "x-go-name": "BlockOnOfficialReviewRequests" + }, + "block_on_outdated_branch": { + "type": "boolean", + "x-go-name": "BlockOnOutdatedBranch" + }, + "block_on_rejected_reviews": { + "type": "boolean", + "x-go-name": "BlockOnRejectedReviews" + }, + "dismiss_stale_approvals": { + "type": "boolean", + "x-go-name": "DismissStaleApprovals" + }, + "enable_approvals_whitelist": { + "type": "boolean", + "x-go-name": "EnableApprovalsWhitelist" + }, + "enable_merge_whitelist": { + "type": "boolean", + "x-go-name": "EnableMergeWhitelist" + }, + "enable_push": { + "type": "boolean", + "x-go-name": "EnablePush" + }, + "enable_push_whitelist": { + "type": "boolean", + "x-go-name": "EnablePushWhitelist" + }, + "enable_status_check": { + "type": "boolean", + "x-go-name": "EnableStatusCheck" + }, + "merge_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MergeWhitelistTeams" + }, + "merge_whitelist_usernames": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MergeWhitelistUsernames" + }, + "protected_file_patterns": { + "type": "string", + "x-go-name": "ProtectedFilePatterns" + }, + "push_whitelist_deploy_keys": { + "type": "boolean", + "x-go-name": "PushWhitelistDeployKeys" + }, + "push_whitelist_teams": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PushWhitelistTeams" + }, + "push_whitelist_usernames": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PushWhitelistUsernames" + }, + "require_signed_commits": { + "type": "boolean", + "x-go-name": "RequireSignedCommits" + }, + "required_approvals": { + "type": "integer", + "format": "int64", + "x-go-name": "RequiredApprovals" + }, + "status_check_contexts": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "StatusCheckContexts" + }, + "unprotected_file_patterns": { + "type": "string", + "x-go-name": "UnprotectedFilePatterns" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditDeadlineOption": { + "description": "EditDeadlineOption options for creating a deadline", + "type": "object", + "required": [ + "due_date" + ], + "properties": { + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditGitHookOption": { + "description": "EditGitHookOption options when modifying one Git hook", + "type": "object", + "properties": { + "content": { + "type": "string", + "x-go-name": "Content" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditHookOption": { + "description": "EditHookOption options when modify one hook", + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-go-name": "Active" + }, + "authorization_header": { + "type": "string", + "x-go-name": "AuthorizationHeader" + }, + "branch_filter": { + "type": "string", + "x-go-name": "BranchFilter" + }, + "config": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Config" + }, + "events": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Events" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditIssueCommentOption": { + "description": "EditIssueCommentOption options for editing a comment", + "type": "object", + "required": [ + "body" + ], + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditIssueOption": { + "description": "EditIssueOption options for editing an issue", + "type": "object", + "properties": { + "assignee": { + "description": "deprecated", + "type": "string", + "x-go-name": "Assignee" + }, + "assignees": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Assignees" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "milestone": { + "type": "integer", + "format": "int64", + "x-go-name": "Milestone" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "unset_due_date": { + "type": "boolean", + "x-go-name": "RemoveDeadline" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditLabelOption": { + "description": "EditLabelOption options for editing a label", + "type": "object", + "properties": { + "color": { + "type": "string", + "x-go-name": "Color", + "example": "#00aabb" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "exclusive": { + "type": "boolean", + "x-go-name": "Exclusive", + "example": false + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditMilestoneOption": { + "description": "EditMilestoneOption options for editing a milestone", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "due_on": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditOrgOption": { + "description": "EditOrgOption options for editing an organization", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "repo_admin_change_team_access": { + "type": "boolean", + "x-go-name": "RepoAdminChangeTeamAccess" + }, + "visibility": { + "description": "possible values are `public`, `limited` or `private`", + "type": "string", + "enum": [ + "public", + "limited", + "private" + ], + "x-go-name": "Visibility" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditPullRequestOption": { + "description": "EditPullRequestOption options when modify pull request", + "type": "object", + "properties": { + "allow_maintainer_edit": { + "type": "boolean", + "x-go-name": "AllowMaintainerEdit" + }, + "assignee": { + "type": "string", + "x-go-name": "Assignee" + }, + "assignees": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Assignees" + }, + "base": { + "type": "string", + "x-go-name": "Base" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "labels": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "Labels" + }, + "milestone": { + "type": "integer", + "format": "int64", + "x-go-name": "Milestone" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "unset_due_date": { + "type": "boolean", + "x-go-name": "RemoveDeadline" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditReactionOption": { + "description": "EditReactionOption contain the reaction type", + "type": "object", + "properties": { + "content": { + "type": "string", + "x-go-name": "Reaction" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditReleaseOption": { + "description": "EditReleaseOption options when editing a release", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Note" + }, + "draft": { + "type": "boolean", + "x-go-name": "IsDraft" + }, + "name": { + "type": "string", + "x-go-name": "Title" + }, + "prerelease": { + "type": "boolean", + "x-go-name": "IsPrerelease" + }, + "tag_name": { + "type": "string", + "x-go-name": "TagName" + }, + "target_commitish": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditRepoOption": { + "description": "EditRepoOption options when editing a repository's properties", + "type": "object", + "properties": { + "allow_manual_merge": { + "description": "either `true` to allow mark pr as merged manually, or `false` to prevent it.", + "type": "boolean", + "x-go-name": "AllowManualMerge" + }, + "allow_merge_commits": { + "description": "either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.", + "type": "boolean", + "x-go-name": "AllowMerge" + }, + "allow_rebase": { + "description": "either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.", + "type": "boolean", + "x-go-name": "AllowRebase" + }, + "allow_rebase_explicit": { + "description": "either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits.", + "type": "boolean", + "x-go-name": "AllowRebaseMerge" + }, + "allow_rebase_update": { + "description": "either `true` to allow updating pull request branch by rebase, or `false` to prevent it.", + "type": "boolean", + "x-go-name": "AllowRebaseUpdate" + }, + "allow_squash_merge": { + "description": "either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.", + "type": "boolean", + "x-go-name": "AllowSquash" + }, + "archived": { + "description": "set to `true` to archive this repository.", + "type": "boolean", + "x-go-name": "Archived" + }, + "autodetect_manual_merge": { + "description": "either `true` to enable AutodetectManualMerge, or `false` to prevent it. Note: In some special cases, misjudgments can occur.", + "type": "boolean", + "x-go-name": "AutodetectManualMerge" + }, + "default_allow_maintainer_edit": { + "description": "set to `true` to allow edits from maintainers by default", + "type": "boolean", + "x-go-name": "DefaultAllowMaintainerEdit" + }, + "default_branch": { + "description": "sets the default branch for this repository.", + "type": "string", + "x-go-name": "DefaultBranch" + }, + "default_delete_branch_after_merge": { + "description": "set to `true` to delete pr branch after merge by default", + "type": "boolean", + "x-go-name": "DefaultDeleteBranchAfterMerge" + }, + "default_merge_style": { + "description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", or \"squash\".", + "type": "string", + "x-go-name": "DefaultMergeStyle" + }, + "description": { + "description": "a short description of the repository.", + "type": "string", + "x-go-name": "Description" + }, + "enable_prune": { + "description": "enable prune - remove obsolete remote-tracking references", + "type": "boolean", + "x-go-name": "EnablePrune" + }, + "external_tracker": { + "$ref": "#/definitions/ExternalTracker" + }, + "external_wiki": { + "$ref": "#/definitions/ExternalWiki" + }, + "has_issues": { + "description": "either `true` to enable issues for this repository or `false` to disable them.", + "type": "boolean", + "x-go-name": "HasIssues" + }, + "has_projects": { + "description": "either `true` to enable project unit, or `false` to disable them.", + "type": "boolean", + "x-go-name": "HasProjects" + }, + "has_pull_requests": { + "description": "either `true` to allow pull requests, or `false` to prevent pull request.", + "type": "boolean", + "x-go-name": "HasPullRequests" + }, + "has_wiki": { + "description": "either `true` to enable the wiki for this repository or `false` to disable it.", + "type": "boolean", + "x-go-name": "HasWiki" + }, + "ignore_whitespace_conflicts": { + "description": "either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace.", + "type": "boolean", + "x-go-name": "IgnoreWhitespaceConflicts" + }, + "internal_tracker": { + "$ref": "#/definitions/InternalTracker" + }, + "mirror_interval": { + "description": "set to a string like `8h30m0s` to set the mirror interval time", + "type": "string", + "x-go-name": "MirrorInterval" + }, + "name": { + "description": "name of the repository", + "type": "string", + "uniqueItems": true, + "x-go-name": "Name" + }, + "private": { + "description": "either `true` to make the repository private or `false` to make it public.\nNote: you will get a 422 error if the organization restricts changing repository visibility to organization\nowners and a non-owner tries to change the value of private.", + "type": "boolean", + "x-go-name": "Private" + }, + "template": { + "description": "either `true` to make this repository a template or `false` to make it a normal repository", + "type": "boolean", + "x-go-name": "Template" + }, + "website": { + "description": "a URL with more information about the repository.", + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditTeamOption": { + "description": "EditTeamOption options for editing a team", + "type": "object", + "required": [ + "name" + ], + "properties": { + "can_create_org_repo": { + "type": "boolean", + "x-go-name": "CanCreateOrgRepo" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "includes_all_repositories": { + "type": "boolean", + "x-go-name": "IncludesAllRepositories" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permission": { + "type": "string", + "enum": [ + "read", + "write", + "admin" + ], + "x-go-name": "Permission" + }, + "units": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Units", + "example": [ + "repo.code", + "repo.issues", + "repo.ext_issues", + "repo.wiki", + "repo.pulls", + "repo.releases", + "repo.projects", + "repo.ext_wiki" + ] + }, + "units_map": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "UnitsMap", + "example": { + "repo.code": "read", + "repo.ext_issues": "none", + "repo.ext_wiki": "none", + "repo.issues": "write", + "repo.projects": "none", + "repo.pulls": "owner", + "repo.releases": "none", + "repo.wiki": "admin" + } + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "EditUserOption": { + "description": "EditUserOption edit user options", + "type": "object", + "required": [ + "source_id", + "login_name" + ], + "properties": { + "active": { + "type": "boolean", + "x-go-name": "Active" + }, + "admin": { + "type": "boolean", + "x-go-name": "Admin" + }, + "allow_create_organization": { + "type": "boolean", + "x-go-name": "AllowCreateOrganization" + }, + "allow_git_hook": { + "type": "boolean", + "x-go-name": "AllowGitHook" + }, + "allow_import_local": { + "type": "boolean", + "x-go-name": "AllowImportLocal" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "login_name": { + "type": "string", + "x-go-name": "LoginName" + }, + "max_repo_creation": { + "type": "integer", + "format": "int64", + "x-go-name": "MaxRepoCreation" + }, + "must_change_password": { + "type": "boolean", + "x-go-name": "MustChangePassword" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "prohibit_login": { + "type": "boolean", + "x-go-name": "ProhibitLogin" + }, + "restricted": { + "type": "boolean", + "x-go-name": "Restricted" + }, + "source_id": { + "type": "integer", + "format": "int64", + "x-go-name": "SourceID" + }, + "visibility": { + "type": "string", + "x-go-name": "Visibility" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Email": { + "description": "Email an email address belonging to a user", + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "primary": { + "type": "boolean", + "x-go-name": "Primary" + }, + "verified": { + "type": "boolean", + "x-go-name": "Verified" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ExternalTracker": { + "description": "ExternalTracker represents settings for external tracker", + "type": "object", + "properties": { + "external_tracker_format": { + "description": "External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.", + "type": "string", + "x-go-name": "ExternalTrackerFormat" + }, + "external_tracker_regexp_pattern": { + "description": "External Issue Tracker issue regular expression", + "type": "string", + "x-go-name": "ExternalTrackerRegexpPattern" + }, + "external_tracker_style": { + "description": "External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp`", + "type": "string", + "x-go-name": "ExternalTrackerStyle" + }, + "external_tracker_url": { + "description": "URL of external issue tracker.", + "type": "string", + "x-go-name": "ExternalTrackerURL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ExternalWiki": { + "description": "ExternalWiki represents setting for external wiki", + "type": "object", + "properties": { + "external_wiki_url": { + "description": "URL of external wiki.", + "type": "string", + "x-go-name": "ExternalWikiURL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "FileCommitResponse": { + "type": "object", + "title": "FileCommitResponse contains information generated from a Git commit for a repo's file.", + "properties": { + "author": { + "$ref": "#/definitions/CommitUser" + }, + "committer": { + "$ref": "#/definitions/CommitUser" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "parents": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitMeta" + }, + "x-go-name": "Parents" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "tree": { + "$ref": "#/definitions/CommitMeta" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "FileDeleteResponse": { + "description": "FileDeleteResponse contains information about a repo's file that was deleted", + "type": "object", + "properties": { + "commit": { + "$ref": "#/definitions/FileCommitResponse" + }, + "content": { + "x-go-name": "Content" + }, + "verification": { + "$ref": "#/definitions/PayloadCommitVerification" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "FileLinksResponse": { + "description": "FileLinksResponse contains the links for a repo's file", + "type": "object", + "properties": { + "git": { + "type": "string", + "x-go-name": "GitURL" + }, + "html": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "self": { + "type": "string", + "x-go-name": "Self" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "FileResponse": { + "description": "FileResponse contains information about a repo's file", + "type": "object", + "properties": { + "commit": { + "$ref": "#/definitions/FileCommitResponse" + }, + "content": { + "$ref": "#/definitions/ContentsResponse" + }, + "verification": { + "$ref": "#/definitions/PayloadCommitVerification" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GPGKey": { + "description": "GPGKey a user GPG key to sign commit and tag in repository", + "type": "object", + "properties": { + "can_certify": { + "type": "boolean", + "x-go-name": "CanCertify" + }, + "can_encrypt_comms": { + "type": "boolean", + "x-go-name": "CanEncryptComms" + }, + "can_encrypt_storage": { + "type": "boolean", + "x-go-name": "CanEncryptStorage" + }, + "can_sign": { + "type": "boolean", + "x-go-name": "CanSign" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "emails": { + "type": "array", + "items": { + "$ref": "#/definitions/GPGKeyEmail" + }, + "x-go-name": "Emails" + }, + "expires_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Expires" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key_id": { + "type": "string", + "x-go-name": "KeyID" + }, + "primary_key_id": { + "type": "string", + "x-go-name": "PrimaryKeyID" + }, + "public_key": { + "type": "string", + "x-go-name": "PublicKey" + }, + "subkeys": { + "type": "array", + "items": { + "$ref": "#/definitions/GPGKey" + }, + "x-go-name": "SubsKey" + }, + "verified": { + "type": "boolean", + "x-go-name": "Verified" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GPGKeyEmail": { + "description": "GPGKeyEmail an email attached to a GPGKey", + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "verified": { + "type": "boolean", + "x-go-name": "Verified" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GeneralAPISettings": { + "description": "GeneralAPISettings contains global api settings exposed by it", + "type": "object", + "properties": { + "default_git_trees_per_page": { + "type": "integer", + "format": "int64", + "x-go-name": "DefaultGitTreesPerPage" + }, + "default_max_blob_size": { + "type": "integer", + "format": "int64", + "x-go-name": "DefaultMaxBlobSize" + }, + "default_paging_num": { + "type": "integer", + "format": "int64", + "x-go-name": "DefaultPagingNum" + }, + "max_response_items": { + "type": "integer", + "format": "int64", + "x-go-name": "MaxResponseItems" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GeneralAttachmentSettings": { + "description": "GeneralAttachmentSettings contains global Attachment settings exposed by API", + "type": "object", + "properties": { + "allowed_types": { + "type": "string", + "x-go-name": "AllowedTypes" + }, + "enabled": { + "type": "boolean", + "x-go-name": "Enabled" + }, + "max_files": { + "type": "integer", + "format": "int64", + "x-go-name": "MaxFiles" + }, + "max_size": { + "type": "integer", + "format": "int64", + "x-go-name": "MaxSize" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GeneralRepoSettings": { + "description": "GeneralRepoSettings contains global repository settings exposed by API", + "type": "object", + "properties": { + "http_git_disabled": { + "type": "boolean", + "x-go-name": "HTTPGitDisabled" + }, + "lfs_disabled": { + "type": "boolean", + "x-go-name": "LFSDisabled" + }, + "migrations_disabled": { + "type": "boolean", + "x-go-name": "MigrationsDisabled" + }, + "mirrors_disabled": { + "type": "boolean", + "x-go-name": "MirrorsDisabled" + }, + "stars_disabled": { + "type": "boolean", + "x-go-name": "StarsDisabled" + }, + "time_tracking_disabled": { + "type": "boolean", + "x-go-name": "TimeTrackingDisabled" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GeneralUISettings": { + "description": "GeneralUISettings contains global ui settings exposed by API", + "type": "object", + "properties": { + "allowed_reactions": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "AllowedReactions" + }, + "custom_emojis": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "CustomEmojis" + }, + "default_theme": { + "type": "string", + "x-go-name": "DefaultTheme" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GenerateRepoOption": { + "description": "GenerateRepoOption options when creating repository using a template", + "type": "object", + "required": [ + "owner", + "name" + ], + "properties": { + "avatar": { + "description": "include avatar of the template repo", + "type": "boolean", + "x-go-name": "Avatar" + }, + "default_branch": { + "description": "Default branch of the new repository", + "type": "string", + "x-go-name": "DefaultBranch" + }, + "description": { + "description": "Description of the repository to create", + "type": "string", + "x-go-name": "Description" + }, + "git_content": { + "description": "include git content of default branch in template repo", + "type": "boolean", + "x-go-name": "GitContent" + }, + "git_hooks": { + "description": "include git hooks in template repo", + "type": "boolean", + "x-go-name": "GitHooks" + }, + "labels": { + "description": "include labels in template repo", + "type": "boolean", + "x-go-name": "Labels" + }, + "name": { + "description": "Name of the repository to create", + "type": "string", + "uniqueItems": true, + "x-go-name": "Name" + }, + "owner": { + "description": "The organization or person who will own the new repository", + "type": "string", + "x-go-name": "Owner" + }, + "private": { + "description": "Whether the repository is private", + "type": "boolean", + "x-go-name": "Private" + }, + "topics": { + "description": "include topics in template repo", + "type": "boolean", + "x-go-name": "Topics" + }, + "webhooks": { + "description": "include webhooks in template repo", + "type": "boolean", + "x-go-name": "Webhooks" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GitBlobResponse": { + "description": "GitBlobResponse represents a git blob", + "type": "object", + "properties": { + "content": { + "type": "string", + "x-go-name": "Content" + }, + "encoding": { + "type": "string", + "x-go-name": "Encoding" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GitEntry": { + "description": "GitEntry represents a git tree", + "type": "object", + "properties": { + "mode": { + "type": "string", + "x-go-name": "Mode" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GitHook": { + "description": "GitHook represents a Git repository hook", + "type": "object", + "properties": { + "content": { + "type": "string", + "x-go-name": "Content" + }, + "is_active": { + "type": "boolean", + "x-go-name": "IsActive" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GitObject": { + "type": "object", + "title": "GitObject represents a Git object.", + "properties": { + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "GitTreeResponse": { + "description": "GitTreeResponse returns a git tree", + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "tree": { + "type": "array", + "items": { + "$ref": "#/definitions/GitEntry" + }, + "x-go-name": "Entries" + }, + "truncated": { + "type": "boolean", + "x-go-name": "Truncated" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Hook": { + "description": "Hook a hook is a web hook when one repository changed", + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-go-name": "Active" + }, + "authorization_header": { + "type": "string", + "x-go-name": "AuthorizationHeader" + }, + "config": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Config" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "events": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Events" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Identity": { + "description": "Identity for a person's identity like an author or committer", + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "InternalTracker": { + "description": "InternalTracker represents settings for internal tracker", + "type": "object", + "properties": { + "allow_only_contributors_to_track_time": { + "description": "Let only contributors track time (Built-in issue tracker)", + "type": "boolean", + "x-go-name": "AllowOnlyContributorsToTrackTime" + }, + "enable_issue_dependencies": { + "description": "Enable dependencies for issues and pull requests (Built-in issue tracker)", + "type": "boolean", + "x-go-name": "EnableIssueDependencies" + }, + "enable_time_tracker": { + "description": "Enable time tracking (Built-in issue tracker)", + "type": "boolean", + "x-go-name": "EnableTimeTracker" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Issue": { + "description": "Issue represents an issue in a repository", + "type": "object", + "properties": { + "assets": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + }, + "x-go-name": "Attachments" + }, + "assignee": { + "$ref": "#/definitions/User" + }, + "assignees": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + }, + "x-go-name": "Assignees" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "closed_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Closed" + }, + "comments": { + "type": "integer", + "format": "int64", + "x-go-name": "Comments" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "is_locked": { + "type": "boolean", + "x-go-name": "IsLocked" + }, + "labels": { + "type": "array", + "items": { + "$ref": "#/definitions/Label" + }, + "x-go-name": "Labels" + }, + "milestone": { + "$ref": "#/definitions/Milestone" + }, + "number": { + "type": "integer", + "format": "int64", + "x-go-name": "Index" + }, + "original_author": { + "type": "string", + "x-go-name": "OriginalAuthor" + }, + "original_author_id": { + "type": "integer", + "format": "int64", + "x-go-name": "OriginalAuthorID" + }, + "pull_request": { + "$ref": "#/definitions/PullRequestMeta" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "repository": { + "$ref": "#/definitions/RepositoryMeta" + }, + "state": { + "$ref": "#/definitions/StateType" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "IssueDeadline": { + "description": "IssueDeadline represents an issue deadline", + "type": "object", + "properties": { + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "IssueFormField": { + "description": "IssueFormField represents a form field", + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": {}, + "x-go-name": "Attributes" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "type": { + "$ref": "#/definitions/IssueFormFieldType" + }, + "validations": { + "type": "object", + "additionalProperties": {}, + "x-go-name": "Validations" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "IssueFormFieldType": { + "type": "string", + "title": "IssueFormFieldType defines issue form field type, can be \"markdown\", \"textarea\", \"input\", \"dropdown\" or \"checkboxes\"", + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "IssueLabelsOption": { + "description": "IssueLabelsOption a collection of labels", + "type": "object", + "properties": { + "labels": { + "description": "list of label IDs", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "Labels" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "IssueTemplate": { + "description": "IssueTemplate represents an issue template for a repository", + "type": "object", + "properties": { + "about": { + "type": "string", + "x-go-name": "About" + }, + "body": { + "type": "array", + "items": { + "$ref": "#/definitions/IssueFormField" + }, + "x-go-name": "Fields" + }, + "content": { + "type": "string", + "x-go-name": "Content" + }, + "file_name": { + "type": "string", + "x-go-name": "FileName" + }, + "labels": { + "$ref": "#/definitions/IssueTemplateLabels" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "IssueTemplateLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Label": { + "description": "Label a label to an issue or a pr", + "type": "object", + "properties": { + "color": { + "type": "string", + "x-go-name": "Color", + "example": "00aabb" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "exclusive": { + "type": "boolean", + "x-go-name": "Exclusive", + "example": false + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "MarkdownOption": { + "description": "MarkdownOption markdown options", + "type": "object", + "properties": { + "Context": { + "description": "Context to render\n\nin: body", + "type": "string" + }, + "Mode": { + "description": "Mode to render\n\nin: body", + "type": "string" + }, + "Text": { + "description": "Text markdown to render\n\nin: body", + "type": "string" + }, + "Wiki": { + "description": "Is it a wiki page ?\n\nin: body", + "type": "boolean" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "MergePullRequestOption": { + "description": "MergePullRequestForm form for merging Pull Request", + "type": "object", + "required": [ + "Do" + ], + "properties": { + "Do": { + "type": "string", + "enum": [ + "merge", + "rebase", + "rebase-merge", + "squash", + "manually-merged" + ] + }, + "MergeCommitID": { + "type": "string" + }, + "MergeMessageField": { + "type": "string" + }, + "MergeTitleField": { + "type": "string" + }, + "delete_branch_after_merge": { + "type": "boolean", + "x-go-name": "DeleteBranchAfterMerge" + }, + "force_merge": { + "type": "boolean", + "x-go-name": "ForceMerge" + }, + "head_commit_id": { + "type": "string", + "x-go-name": "HeadCommitID" + }, + "merge_when_checks_succeed": { + "type": "boolean", + "x-go-name": "MergeWhenChecksSucceed" + } + }, + "x-go-name": "MergePullRequestForm", + "x-go-package": "code.gitea.io/gitea/services/forms" + }, + "MigrateRepoOptions": { + "description": "MigrateRepoOptions options for migrating repository's\nthis is used to interact with api v1", + "type": "object", + "required": [ + "clone_addr", + "repo_name" + ], + "properties": { + "auth_password": { + "type": "string", + "x-go-name": "AuthPassword" + }, + "auth_token": { + "type": "string", + "x-go-name": "AuthToken" + }, + "auth_username": { + "type": "string", + "x-go-name": "AuthUsername" + }, + "clone_addr": { + "type": "string", + "x-go-name": "CloneAddr" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "issues": { + "type": "boolean", + "x-go-name": "Issues" + }, + "labels": { + "type": "boolean", + "x-go-name": "Labels" + }, + "lfs": { + "type": "boolean", + "x-go-name": "LFS" + }, + "lfs_endpoint": { + "type": "string", + "x-go-name": "LFSEndpoint" + }, + "milestones": { + "type": "boolean", + "x-go-name": "Milestones" + }, + "mirror": { + "type": "boolean", + "x-go-name": "Mirror" + }, + "mirror_interval": { + "type": "string", + "x-go-name": "MirrorInterval" + }, + "private": { + "type": "boolean", + "x-go-name": "Private" + }, + "pull_requests": { + "type": "boolean", + "x-go-name": "PullRequests" + }, + "releases": { + "type": "boolean", + "x-go-name": "Releases" + }, + "repo_name": { + "type": "string", + "x-go-name": "RepoName" + }, + "repo_owner": { + "description": "Name of User or Organisation who will own Repo after migration", + "type": "string", + "x-go-name": "RepoOwner" + }, + "service": { + "type": "string", + "enum": [ + "git", + "github", + "gitea", + "gitlab" + ], + "x-go-name": "Service" + }, + "uid": { + "description": "deprecated (only for backwards compatibility)", + "type": "integer", + "format": "int64", + "x-go-name": "RepoOwnerID" + }, + "wiki": { + "type": "boolean", + "x-go-name": "Wiki" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Milestone": { + "description": "Milestone milestone is a collection of issues on one repository", + "type": "object", + "properties": { + "closed_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Closed" + }, + "closed_issues": { + "type": "integer", + "format": "int64", + "x-go-name": "ClosedIssues" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "due_on": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "open_issues": { + "type": "integer", + "format": "int64", + "x-go-name": "OpenIssues" + }, + "state": { + "$ref": "#/definitions/StateType" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NodeInfo": { + "description": "NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks", + "type": "object", + "properties": { + "metadata": { + "type": "object", + "x-go-name": "Metadata" + }, + "openRegistrations": { + "type": "boolean", + "x-go-name": "OpenRegistrations" + }, + "protocols": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Protocols" + }, + "services": { + "$ref": "#/definitions/NodeInfoServices" + }, + "software": { + "$ref": "#/definitions/NodeInfoSoftware" + }, + "usage": { + "$ref": "#/definitions/NodeInfoUsage" + }, + "version": { + "type": "string", + "x-go-name": "Version" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NodeInfoServices": { + "description": "NodeInfoServices contains the third party sites this server can connect to via their application API", + "type": "object", + "properties": { + "inbound": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Inbound" + }, + "outbound": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Outbound" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NodeInfoSoftware": { + "description": "NodeInfoSoftware contains Metadata about server software in use", + "type": "object", + "properties": { + "homepage": { + "type": "string", + "x-go-name": "Homepage" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "repository": { + "type": "string", + "x-go-name": "Repository" + }, + "version": { + "type": "string", + "x-go-name": "Version" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NodeInfoUsage": { + "description": "NodeInfoUsage contains usage statistics for this server", + "type": "object", + "properties": { + "localComments": { + "type": "integer", + "format": "int64", + "x-go-name": "LocalComments" + }, + "localPosts": { + "type": "integer", + "format": "int64", + "x-go-name": "LocalPosts" + }, + "users": { + "$ref": "#/definitions/NodeInfoUsageUsers" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NodeInfoUsageUsers": { + "description": "NodeInfoUsageUsers contains statistics about the users of this server", + "type": "object", + "properties": { + "activeHalfyear": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveHalfyear" + }, + "activeMonth": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveMonth" + }, + "total": { + "type": "integer", + "format": "int64", + "x-go-name": "Total" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Note": { + "description": "Note contains information related to a git note", + "type": "object", + "properties": { + "commit": { + "$ref": "#/definitions/Commit" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NotificationCount": { + "description": "NotificationCount number of unread notifications", + "type": "object", + "properties": { + "new": { + "type": "integer", + "format": "int64", + "x-go-name": "New" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NotificationSubject": { + "description": "NotificationSubject contains the notification subject (Issue/Pull/Commit)", + "type": "object", + "properties": { + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "latest_comment_html_url": { + "type": "string", + "x-go-name": "LatestCommentHTMLURL" + }, + "latest_comment_url": { + "type": "string", + "x-go-name": "LatestCommentURL" + }, + "state": { + "$ref": "#/definitions/StateType" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "type": { + "$ref": "#/definitions/NotifySubjectType" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NotificationThread": { + "description": "NotificationThread expose Notification on API", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "pinned": { + "type": "boolean", + "x-go-name": "Pinned" + }, + "repository": { + "$ref": "#/definitions/Repository" + }, + "subject": { + "$ref": "#/definitions/NotificationSubject" + }, + "unread": { + "type": "boolean", + "x-go-name": "Unread" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "NotifySubjectType": { + "description": "NotifySubjectType represent type of notification subject", + "type": "string", + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "OAuth2Application": { + "type": "object", + "title": "OAuth2Application represents an OAuth2 application.", + "properties": { + "client_id": { + "type": "string", + "x-go-name": "ClientID" + }, + "client_secret": { + "type": "string", + "x-go-name": "ClientSecret" + }, + "confidential_client": { + "type": "boolean", + "x-go-name": "ConfidentialClient" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "RedirectURIs" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Organization": { + "description": "Organization represents an organization", + "type": "object", + "properties": { + "avatar_url": { + "type": "string", + "x-go-name": "AvatarURL" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "repo_admin_change_team_access": { + "type": "boolean", + "x-go-name": "RepoAdminChangeTeamAccess" + }, + "username": { + "description": "deprecated", + "type": "string", + "x-go-name": "UserName" + }, + "visibility": { + "type": "string", + "x-go-name": "Visibility" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "OrganizationPermissions": { + "description": "OrganizationPermissions list different users permissions on an organization", + "type": "object", + "properties": { + "can_create_repository": { + "type": "boolean", + "x-go-name": "CanCreateRepository" + }, + "can_read": { + "type": "boolean", + "x-go-name": "CanRead" + }, + "can_write": { + "type": "boolean", + "x-go-name": "CanWrite" + }, + "is_admin": { + "type": "boolean", + "x-go-name": "IsAdmin" + }, + "is_owner": { + "type": "boolean", + "x-go-name": "IsOwner" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PRBranchInfo": { + "description": "PRBranchInfo information about a branch", + "type": "object", + "properties": { + "label": { + "type": "string", + "x-go-name": "Name" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "repo": { + "$ref": "#/definitions/Repository" + }, + "repo_id": { + "type": "integer", + "format": "int64", + "x-go-name": "RepoID" + }, + "sha": { + "type": "string", + "x-go-name": "Sha" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Package": { + "description": "Package represents a package", + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "creator": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "repository": { + "$ref": "#/definitions/Repository" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "version": { + "type": "string", + "x-go-name": "Version" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PackageFile": { + "description": "PackageFile represents a package file", + "type": "object", + "properties": { + "Size": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "md5": { + "type": "string", + "x-go-name": "HashMD5" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "sha1": { + "type": "string", + "x-go-name": "HashSHA1" + }, + "sha256": { + "type": "string", + "x-go-name": "HashSHA256" + }, + "sha512": { + "type": "string", + "x-go-name": "HashSHA512" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PayloadCommit": { + "description": "PayloadCommit represents a commit", + "type": "object", + "properties": { + "added": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Added" + }, + "author": { + "$ref": "#/definitions/PayloadUser" + }, + "committer": { + "$ref": "#/definitions/PayloadUser" + }, + "id": { + "description": "sha1 hash of the commit", + "type": "string", + "x-go-name": "ID" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "modified": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Modified" + }, + "removed": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Removed" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "x-go-name": "Timestamp" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "verification": { + "$ref": "#/definitions/PayloadCommitVerification" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PayloadCommitVerification": { + "description": "PayloadCommitVerification represents the GPG verification of a commit", + "type": "object", + "properties": { + "payload": { + "type": "string", + "x-go-name": "Payload" + }, + "reason": { + "type": "string", + "x-go-name": "Reason" + }, + "signature": { + "type": "string", + "x-go-name": "Signature" + }, + "signer": { + "$ref": "#/definitions/PayloadUser" + }, + "verified": { + "type": "boolean", + "x-go-name": "Verified" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PayloadUser": { + "description": "PayloadUser represents the author or committer of a commit", + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "name": { + "description": "Full name of the commit author", + "type": "string", + "x-go-name": "Name" + }, + "username": { + "type": "string", + "x-go-name": "UserName" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Permission": { + "description": "Permission represents a set of permissions", + "type": "object", + "properties": { + "admin": { + "type": "boolean", + "x-go-name": "Admin" + }, + "pull": { + "type": "boolean", + "x-go-name": "Pull" + }, + "push": { + "type": "boolean", + "x-go-name": "Push" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PublicKey": { + "description": "PublicKey publickey is a user key to push code to repository", + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "fingerprint": { + "type": "string", + "x-go-name": "Fingerprint" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "key_type": { + "type": "string", + "x-go-name": "KeyType" + }, + "read_only": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PullRequest": { + "description": "PullRequest represents a pull request", + "type": "object", + "properties": { + "allow_maintainer_edit": { + "type": "boolean", + "x-go-name": "AllowMaintainerEdit" + }, + "assignee": { + "$ref": "#/definitions/User" + }, + "assignees": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + }, + "x-go-name": "Assignees" + }, + "base": { + "$ref": "#/definitions/PRBranchInfo" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "closed_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Closed" + }, + "comments": { + "type": "integer", + "format": "int64", + "x-go-name": "Comments" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "diff_url": { + "type": "string", + "x-go-name": "DiffURL" + }, + "due_date": { + "type": "string", + "format": "date-time", + "x-go-name": "Deadline" + }, + "head": { + "$ref": "#/definitions/PRBranchInfo" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "is_locked": { + "type": "boolean", + "x-go-name": "IsLocked" + }, + "labels": { + "type": "array", + "items": { + "$ref": "#/definitions/Label" + }, + "x-go-name": "Labels" + }, + "merge_base": { + "type": "string", + "x-go-name": "MergeBase" + }, + "merge_commit_sha": { + "type": "string", + "x-go-name": "MergedCommitID" + }, + "mergeable": { + "type": "boolean", + "x-go-name": "Mergeable" + }, + "merged": { + "type": "boolean", + "x-go-name": "HasMerged" + }, + "merged_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Merged" + }, + "merged_by": { + "$ref": "#/definitions/User" + }, + "milestone": { + "$ref": "#/definitions/Milestone" + }, + "number": { + "type": "integer", + "format": "int64", + "x-go-name": "Index" + }, + "patch_url": { + "type": "string", + "x-go-name": "PatchURL" + }, + "state": { + "$ref": "#/definitions/StateType" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PullRequestMeta": { + "description": "PullRequestMeta PR info if an issue is a PR", + "type": "object", + "properties": { + "merged": { + "type": "boolean", + "x-go-name": "HasMerged" + }, + "merged_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Merged" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PullReview": { + "description": "PullReview represents a pull request review", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + }, + "comments_count": { + "type": "integer", + "format": "int64", + "x-go-name": "CodeCommentsCount" + }, + "commit_id": { + "type": "string", + "x-go-name": "CommitID" + }, + "dismissed": { + "type": "boolean", + "x-go-name": "Dismissed" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "official": { + "type": "boolean", + "x-go-name": "Official" + }, + "pull_request_url": { + "type": "string", + "x-go-name": "HTMLPullURL" + }, + "stale": { + "type": "boolean", + "x-go-name": "Stale" + }, + "state": { + "$ref": "#/definitions/ReviewStateType" + }, + "submitted_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Submitted" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PullReviewComment": { + "description": "PullReviewComment represents a comment on a pull request review", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + }, + "commit_id": { + "type": "string", + "x-go-name": "CommitID" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "diff_hunk": { + "type": "string", + "x-go-name": "DiffHunk" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "original_commit_id": { + "type": "string", + "x-go-name": "OrigCommitID" + }, + "original_position": { + "type": "integer", + "format": "uint64", + "x-go-name": "OldLineNum" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "position": { + "type": "integer", + "format": "uint64", + "x-go-name": "LineNum" + }, + "pull_request_review_id": { + "type": "integer", + "format": "int64", + "x-go-name": "ReviewID" + }, + "pull_request_url": { + "type": "string", + "x-go-name": "HTMLPullURL" + }, + "resolver": { + "$ref": "#/definitions/User" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PullReviewRequestOptions": { + "description": "PullReviewRequestOptions are options to add or remove pull review requests", + "type": "object", + "properties": { + "reviewers": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Reviewers" + }, + "team_reviewers": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "TeamReviewers" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "PushMirror": { + "description": "PushMirror represents information of a push mirror", + "type": "object", + "properties": { + "created": { + "type": "string", + "x-go-name": "CreatedUnix" + }, + "interval": { + "type": "string", + "x-go-name": "Interval" + }, + "last_error": { + "type": "string", + "x-go-name": "LastError" + }, + "last_update": { + "type": "string", + "x-go-name": "LastUpdateUnix" + }, + "remote_address": { + "type": "string", + "x-go-name": "RemoteAddress" + }, + "remote_name": { + "type": "string", + "x-go-name": "RemoteName" + }, + "repo_name": { + "type": "string", + "x-go-name": "RepoName" + }, + "sync_on_commit": { + "type": "boolean", + "x-go-name": "SyncOnCommit" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Reaction": { + "description": "Reaction contain one reaction", + "type": "object", + "properties": { + "content": { + "type": "string", + "x-go-name": "Reaction" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Reference": { + "type": "object", + "title": "Reference represents a Git reference.", + "properties": { + "object": { + "$ref": "#/definitions/GitObject" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Release": { + "description": "Release represents a repository release", + "type": "object", + "properties": { + "assets": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + }, + "x-go-name": "Attachments" + }, + "author": { + "$ref": "#/definitions/User" + }, + "body": { + "type": "string", + "x-go-name": "Note" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "draft": { + "type": "boolean", + "x-go-name": "IsDraft" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Title" + }, + "prerelease": { + "type": "boolean", + "x-go-name": "IsPrerelease" + }, + "published_at": { + "type": "string", + "format": "date-time", + "x-go-name": "PublishedAt" + }, + "tag_name": { + "type": "string", + "x-go-name": "TagName" + }, + "tarball_url": { + "type": "string", + "x-go-name": "TarURL" + }, + "target_commitish": { + "type": "string", + "x-go-name": "Target" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "zipball_url": { + "type": "string", + "x-go-name": "ZipURL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "RepoCollaboratorPermission": { + "description": "RepoCollaboratorPermission to get repository permission for a collaborator", + "type": "object", + "properties": { + "permission": { + "type": "string", + "x-go-name": "Permission" + }, + "role_name": { + "type": "string", + "x-go-name": "RoleName" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "RepoCommit": { + "type": "object", + "title": "RepoCommit contains information of a commit in the context of a repository.", + "properties": { + "author": { + "$ref": "#/definitions/CommitUser" + }, + "committer": { + "$ref": "#/definitions/CommitUser" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "tree": { + "$ref": "#/definitions/CommitMeta" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "verification": { + "$ref": "#/definitions/PayloadCommitVerification" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "RepoTopicOptions": { + "description": "RepoTopicOptions a collection of repo topic names", + "type": "object", + "properties": { + "topics": { + "description": "list of topic names", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Topics" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "RepoTransfer": { + "description": "RepoTransfer represents a pending repo transfer", + "type": "object", + "properties": { + "doer": { + "$ref": "#/definitions/User" + }, + "recipient": { + "$ref": "#/definitions/User" + }, + "teams": { + "type": "array", + "items": { + "$ref": "#/definitions/Team" + }, + "x-go-name": "Teams" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Repository": { + "description": "Repository represents a repository", + "type": "object", + "properties": { + "allow_merge_commits": { + "type": "boolean", + "x-go-name": "AllowMerge" + }, + "allow_rebase": { + "type": "boolean", + "x-go-name": "AllowRebase" + }, + "allow_rebase_explicit": { + "type": "boolean", + "x-go-name": "AllowRebaseMerge" + }, + "allow_rebase_update": { + "type": "boolean", + "x-go-name": "AllowRebaseUpdate" + }, + "allow_squash_merge": { + "type": "boolean", + "x-go-name": "AllowSquash" + }, + "archived": { + "type": "boolean", + "x-go-name": "Archived" + }, + "avatar_url": { + "type": "string", + "x-go-name": "AvatarURL" + }, + "clone_url": { + "type": "string", + "x-go-name": "CloneURL" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "default_allow_maintainer_edit": { + "type": "boolean", + "x-go-name": "DefaultAllowMaintainerEdit" + }, + "default_branch": { + "type": "string", + "x-go-name": "DefaultBranch" + }, + "default_delete_branch_after_merge": { + "type": "boolean", + "x-go-name": "DefaultDeleteBranchAfterMerge" + }, + "default_merge_style": { + "type": "string", + "x-go-name": "DefaultMergeStyle" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "empty": { + "type": "boolean", + "x-go-name": "Empty" + }, + "external_tracker": { + "$ref": "#/definitions/ExternalTracker" + }, + "external_wiki": { + "$ref": "#/definitions/ExternalWiki" + }, + "fork": { + "type": "boolean", + "x-go-name": "Fork" + }, + "forks_count": { + "type": "integer", + "format": "int64", + "x-go-name": "Forks" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "has_issues": { + "type": "boolean", + "x-go-name": "HasIssues" + }, + "has_projects": { + "type": "boolean", + "x-go-name": "HasProjects" + }, + "has_pull_requests": { + "type": "boolean", + "x-go-name": "HasPullRequests" + }, + "has_wiki": { + "type": "boolean", + "x-go-name": "HasWiki" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "ignore_whitespace_conflicts": { + "type": "boolean", + "x-go-name": "IgnoreWhitespaceConflicts" + }, + "internal": { + "type": "boolean", + "x-go-name": "Internal" + }, + "internal_tracker": { + "$ref": "#/definitions/InternalTracker" + }, + "language": { + "type": "string", + "x-go-name": "Language" + }, + "languages_url": { + "type": "string", + "x-go-name": "LanguagesURL" + }, + "link": { + "type": "string", + "x-go-name": "Link" + }, + "mirror": { + "type": "boolean", + "x-go-name": "Mirror" + }, + "mirror_interval": { + "type": "string", + "x-go-name": "MirrorInterval" + }, + "mirror_updated": { + "type": "string", + "format": "date-time", + "x-go-name": "MirrorUpdated" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "open_issues_count": { + "type": "integer", + "format": "int64", + "x-go-name": "OpenIssues" + }, + "open_pr_counter": { + "type": "integer", + "format": "int64", + "x-go-name": "OpenPulls" + }, + "original_url": { + "type": "string", + "x-go-name": "OriginalURL" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "parent": { + "$ref": "#/definitions/Repository" + }, + "permissions": { + "$ref": "#/definitions/Permission" + }, + "private": { + "type": "boolean", + "x-go-name": "Private" + }, + "release_counter": { + "type": "integer", + "format": "int64", + "x-go-name": "Releases" + }, + "repo_transfer": { + "$ref": "#/definitions/RepoTransfer" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" + }, + "ssh_url": { + "type": "string", + "x-go-name": "SSHURL" + }, + "stars_count": { + "type": "integer", + "format": "int64", + "x-go-name": "Stars" + }, + "template": { + "type": "boolean", + "x-go-name": "Template" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "watchers_count": { + "type": "integer", + "format": "int64", + "x-go-name": "Watchers" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "RepositoryMeta": { + "description": "RepositoryMeta basic repository information", + "type": "object", + "properties": { + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "owner": { + "type": "string", + "x-go-name": "Owner" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ReviewStateType": { + "description": "ReviewStateType review state type", + "type": "string", + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "SearchResults": { + "description": "SearchResults results of a successful search", + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Repository" + }, + "x-go-name": "Data" + }, + "ok": { + "type": "boolean", + "x-go-name": "OK" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ServerVersion": { + "description": "ServerVersion wraps the version of the server", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-go-name": "Version" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "StateType": { + "description": "StateType issue state type", + "type": "string", + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "StopWatch": { + "description": "StopWatch represent a running stopwatch", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "duration": { + "type": "string", + "x-go-name": "Duration" + }, + "issue_index": { + "type": "integer", + "format": "int64", + "x-go-name": "IssueIndex" + }, + "issue_title": { + "type": "string", + "x-go-name": "IssueTitle" + }, + "repo_name": { + "type": "string", + "x-go-name": "RepoName" + }, + "repo_owner_name": { + "type": "string", + "x-go-name": "RepoOwnerName" + }, + "seconds": { + "type": "integer", + "format": "int64", + "x-go-name": "Seconds" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "SubmitPullReviewOptions": { + "description": "SubmitPullReviewOptions are options to submit a pending pull review", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + }, + "event": { + "$ref": "#/definitions/ReviewStateType" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Tag": { + "description": "Tag represents a repository tag", + "type": "object", + "properties": { + "commit": { + "$ref": "#/definitions/CommitMeta" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "tarball_url": { + "type": "string", + "x-go-name": "TarballURL" + }, + "zipball_url": { + "type": "string", + "x-go-name": "ZipballURL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "Team": { + "description": "Team represents a team in an organization", + "type": "object", + "properties": { + "can_create_org_repo": { + "type": "boolean", + "x-go-name": "CanCreateOrgRepo" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "includes_all_repositories": { + "type": "boolean", + "x-go-name": "IncludesAllRepositories" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "organization": { + "$ref": "#/definitions/Organization" + }, + "permission": { + "type": "string", + "enum": [ + "none", + "read", + "write", + "admin", + "owner" + ], + "x-go-name": "Permission" + }, + "units": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Units", + "example": [ + "repo.code", + "repo.issues", + "repo.ext_issues", + "repo.wiki", + "repo.pulls", + "repo.releases", + "repo.projects", + "repo.ext_wiki" + ] + }, + "units_map": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "UnitsMap", + "example": { + "repo.code": "read", + "repo.ext_issues": "none", + "repo.ext_wiki": "none", + "repo.issues": "write", + "repo.projects": "none", + "repo.pulls": "owner", + "repo.releases": "none", + "repo.wiki": "admin" + } + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "TimeStamp": { + "description": "TimeStamp defines a timestamp", + "type": "integer", + "format": "int64", + "x-go-package": "code.gitea.io/gitea/modules/timeutil" + }, + "TimelineComment": { + "description": "TimelineComment represents a timeline comment (comment of any type) on a commit or issue", + "type": "object", + "properties": { + "assignee": { + "$ref": "#/definitions/User" + }, + "assignee_team": { + "$ref": "#/definitions/Team" + }, + "body": { + "type": "string", + "x-go-name": "Body" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "dependent_issue": { + "$ref": "#/definitions/Issue" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "issue_url": { + "type": "string", + "x-go-name": "IssueURL" + }, + "label": { + "$ref": "#/definitions/Label" + }, + "milestone": { + "$ref": "#/definitions/Milestone" + }, + "new_ref": { + "type": "string", + "x-go-name": "NewRef" + }, + "new_title": { + "type": "string", + "x-go-name": "NewTitle" + }, + "old_milestone": { + "$ref": "#/definitions/Milestone" + }, + "old_project_id": { + "type": "integer", + "format": "int64", + "x-go-name": "OldProjectID" + }, + "old_ref": { + "type": "string", + "x-go-name": "OldRef" + }, + "old_title": { + "type": "string", + "x-go-name": "OldTitle" + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-go-name": "ProjectID" + }, + "pull_request_url": { + "type": "string", + "x-go-name": "PRURL" + }, + "ref_action": { + "type": "string", + "x-go-name": "RefAction" + }, + "ref_comment": { + "$ref": "#/definitions/Comment" + }, + "ref_commit_sha": { + "description": "commit SHA where issue/PR was referenced", + "type": "string", + "x-go-name": "RefCommitSHA" + }, + "ref_issue": { + "$ref": "#/definitions/Issue" + }, + "removed_assignee": { + "description": "whether the assignees were removed or added", + "type": "boolean", + "x-go-name": "RemovedAssignee" + }, + "resolve_doer": { + "$ref": "#/definitions/User" + }, + "review_id": { + "type": "integer", + "format": "int64", + "x-go-name": "ReviewID" + }, + "tracked_time": { + "$ref": "#/definitions/TrackedTime" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "TopicName": { + "description": "TopicName a list of repo topic names", + "type": "object", + "properties": { + "topics": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "TopicNames" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "TopicResponse": { + "description": "TopicResponse for returning topics", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "repo_count": { + "type": "integer", + "format": "int64", + "x-go-name": "RepoCount" + }, + "topic_name": { + "type": "string", + "x-go-name": "Name" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "TrackedTime": { + "description": "TrackedTime worked time for an issue / pr", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "issue": { + "$ref": "#/definitions/Issue" + }, + "issue_id": { + "description": "deprecated (only for backwards compatibility)", + "type": "integer", + "format": "int64", + "x-go-name": "IssueID" + }, + "time": { + "description": "Time in seconds", + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "user_id": { + "description": "deprecated (only for backwards compatibility)", + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + }, + "user_name": { + "type": "string", + "x-go-name": "UserName" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "TransferRepoOption": { + "description": "TransferRepoOption options when transfer a repository's ownership", + "type": "object", + "required": [ + "new_owner" + ], + "properties": { + "new_owner": { + "type": "string", + "x-go-name": "NewOwner" + }, + "team_ids": { + "description": "ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "TeamIDs" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "UpdateFileOptions": { + "description": "UpdateFileOptions options for updating files\nNote: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)", + "type": "object", + "required": [ + "sha", + "content" + ], + "properties": { + "author": { + "$ref": "#/definitions/Identity" + }, + "branch": { + "description": "branch (optional) to base this file from. if not given, the default branch is used", + "type": "string", + "x-go-name": "BranchName" + }, + "committer": { + "$ref": "#/definitions/Identity" + }, + "content": { + "description": "content must be base64 encoded", + "type": "string", + "x-go-name": "Content" + }, + "dates": { + "$ref": "#/definitions/CommitDateOptions" + }, + "from_path": { + "description": "from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL", + "type": "string", + "x-go-name": "FromPath" + }, + "message": { + "description": "message (optional) for the commit of this file. if not supplied, a default message will be used", + "type": "string", + "x-go-name": "Message" + }, + "new_branch": { + "description": "new_branch (optional) will make a new branch from `branch` before creating the file", + "type": "string", + "x-go-name": "NewBranchName" + }, + "sha": { + "description": "sha is the SHA for the file that already exists", + "type": "string", + "x-go-name": "SHA" + }, + "signoff": { + "description": "Add a Signed-off-by trailer by the committer at the end of the commit log message.", + "type": "boolean", + "x-go-name": "Signoff" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "User": { + "description": "User represents a user", + "type": "object", + "properties": { + "active": { + "description": "Is user active", + "type": "boolean", + "x-go-name": "IsActive" + }, + "avatar_url": { + "description": "URL to the user's avatar", + "type": "string", + "x-go-name": "AvatarURL" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "description": { + "description": "the user's description", + "type": "string", + "x-go-name": "Description" + }, + "email": { + "type": "string", + "format": "email", + "x-go-name": "Email" + }, + "followers_count": { + "description": "user counts", + "type": "integer", + "format": "int64", + "x-go-name": "Followers" + }, + "following_count": { + "type": "integer", + "format": "int64", + "x-go-name": "Following" + }, + "full_name": { + "description": "the user's full name", + "type": "string", + "x-go-name": "FullName" + }, + "id": { + "description": "the user's id", + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "is_admin": { + "description": "Is the user an administrator", + "type": "boolean", + "x-go-name": "IsAdmin" + }, + "language": { + "description": "User locale", + "type": "string", + "x-go-name": "Language" + }, + "last_login": { + "type": "string", + "format": "date-time", + "x-go-name": "LastLogin" + }, + "location": { + "description": "the user's location", + "type": "string", + "x-go-name": "Location" + }, + "login": { + "description": "the user's username", + "type": "string", + "x-go-name": "UserName" + }, + "login_name": { + "description": "the user's authentication sign-in name.", + "type": "string", + "default": "empty", + "x-go-name": "LoginName" + }, + "prohibit_login": { + "description": "Is user login prohibited", + "type": "boolean", + "x-go-name": "ProhibitLogin" + }, + "restricted": { + "description": "Is user restricted", + "type": "boolean", + "x-go-name": "Restricted" + }, + "starred_repos_count": { + "type": "integer", + "format": "int64", + "x-go-name": "StarredRepos" + }, + "visibility": { + "description": "User visibility level option: public, limited, private", + "type": "string", + "x-go-name": "Visibility" + }, + "website": { + "description": "the user's website", + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "UserHeatmapData": { + "description": "UserHeatmapData represents the data needed to create a heatmap", + "type": "object", + "properties": { + "contributions": { + "type": "integer", + "format": "int64", + "x-go-name": "Contributions" + }, + "timestamp": { + "$ref": "#/definitions/TimeStamp" + } + }, + "x-go-package": "code.gitea.io/gitea/models/activities" + }, + "UserSettings": { + "description": "UserSettings represents user settings", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "diff_view_style": { + "type": "string", + "x-go-name": "DiffViewStyle" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "hide_activity": { + "type": "boolean", + "x-go-name": "HideActivity" + }, + "hide_email": { + "description": "Privacy", + "type": "boolean", + "x-go-name": "HideEmail" + }, + "language": { + "type": "string", + "x-go-name": "Language" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "UserSettingsOptions": { + "description": "UserSettingsOptions represents options to change user settings", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "diff_view_style": { + "type": "string", + "x-go-name": "DiffViewStyle" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "hide_activity": { + "type": "boolean", + "x-go-name": "HideActivity" + }, + "hide_email": { + "description": "Privacy", + "type": "boolean", + "x-go-name": "HideEmail" + }, + "language": { + "type": "string", + "x-go-name": "Language" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "WatchInfo": { + "description": "WatchInfo represents an API watch status of one repository", + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "ignored": { + "type": "boolean", + "x-go-name": "Ignored" + }, + "reason": { + "x-go-name": "Reason" + }, + "repository_url": { + "type": "string", + "x-go-name": "RepositoryURL" + }, + "subscribed": { + "type": "boolean", + "x-go-name": "Subscribed" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "WikiCommit": { + "description": "WikiCommit page commit/revision", + "type": "object", + "properties": { + "author": { + "$ref": "#/definitions/CommitUser" + }, + "commiter": { + "$ref": "#/definitions/CommitUser" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "sha": { + "type": "string", + "x-go-name": "ID" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "WikiCommitList": { + "description": "WikiCommitList commit/revision list", + "type": "object", + "properties": { + "commits": { + "type": "array", + "items": { + "$ref": "#/definitions/WikiCommit" + }, + "x-go-name": "WikiCommits" + }, + "count": { + "type": "integer", + "format": "int64", + "x-go-name": "Count" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "WikiPage": { + "description": "WikiPage a wiki page", + "type": "object", + "properties": { + "commit_count": { + "type": "integer", + "format": "int64", + "x-go-name": "CommitCount" + }, + "content_base64": { + "description": "Page content, base64 encoded", + "type": "string", + "x-go-name": "ContentBase64" + }, + "footer": { + "type": "string", + "x-go-name": "Footer" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "last_commit": { + "$ref": "#/definitions/WikiCommit" + }, + "sidebar": { + "type": "string", + "x-go-name": "Sidebar" + }, + "sub_url": { + "type": "string", + "x-go-name": "SubURL" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "WikiPageMetaData": { + "description": "WikiPageMetaData wiki page meta information", + "type": "object", + "properties": { + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "last_commit": { + "$ref": "#/definitions/WikiCommit" + }, + "sub_url": { + "type": "string", + "x-go-name": "SubURL" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + } + }, + "responses": { + "AccessToken": { + "description": "AccessToken represents an API access token.", + "schema": { + "$ref": "#/definitions/AccessToken" + } + }, + "AccessTokenList": { + "description": "AccessTokenList represents a list of API access token.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessToken" + } + } + }, + "ActivityPub": { + "description": "ActivityPub", + "schema": { + "$ref": "#/definitions/ActivityPub" + } + }, + "AnnotatedTag": { + "description": "AnnotatedTag", + "schema": { + "$ref": "#/definitions/AnnotatedTag" + } + }, + "Attachment": { + "description": "Attachment", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "AttachmentList": { + "description": "AttachmentList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + } + } + }, + "Branch": { + "description": "Branch", + "schema": { + "$ref": "#/definitions/Branch" + } + }, + "BranchList": { + "description": "BranchList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Branch" + } + } + }, + "BranchProtection": { + "description": "BranchProtection", + "schema": { + "$ref": "#/definitions/BranchProtection" + } + }, + "BranchProtectionList": { + "description": "BranchProtectionList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/BranchProtection" + } + } + }, + "ChangedFileList": { + "description": "ChangedFileList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ChangedFile" + } + }, + "headers": { + "X-HasMore": { + "type": "boolean", + "description": "True if there is another page" + }, + "X-Page": { + "type": "integer", + "format": "int64", + "description": "The current page" + }, + "X-PageCount": { + "type": "integer", + "format": "int64", + "description": "Total number of pages" + }, + "X-PerPage": { + "type": "integer", + "format": "int64", + "description": "Commits per page" + }, + "X-Total": { + "type": "integer", + "format": "int64", + "description": "Total commit count" + } + } + }, + "CombinedStatus": { + "description": "CombinedStatus", + "schema": { + "$ref": "#/definitions/CombinedStatus" + } + }, + "Comment": { + "description": "Comment", + "schema": { + "$ref": "#/definitions/Comment" + } + }, + "CommentList": { + "description": "CommentList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Comment" + } + } + }, + "Commit": { + "description": "Commit", + "schema": { + "$ref": "#/definitions/Commit" + } + }, + "CommitList": { + "description": "CommitList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Commit" + } + }, + "headers": { + "X-HasMore": { + "type": "boolean", + "description": "True if there is another page" + }, + "X-Page": { + "type": "integer", + "format": "int64", + "description": "The current page" + }, + "X-PageCount": { + "type": "integer", + "format": "int64", + "description": "Total number of pages" + }, + "X-PerPage": { + "type": "integer", + "format": "int64", + "description": "Commits per page" + }, + "X-Total": { + "type": "integer", + "format": "int64", + "description": "Total commit count" + } + } + }, + "CommitStatus": { + "description": "CommitStatus", + "schema": { + "$ref": "#/definitions/CommitStatus" + } + }, + "CommitStatusList": { + "description": "CommitStatusList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitStatus" + } + } + }, + "ContentsListResponse": { + "description": "ContentsListResponse", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentsResponse" + } + } + }, + "ContentsResponse": { + "description": "ContentsResponse", + "schema": { + "$ref": "#/definitions/ContentsResponse" + } + }, + "CronList": { + "description": "CronList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Cron" + } + } + }, + "DeployKey": { + "description": "DeployKey", + "schema": { + "$ref": "#/definitions/DeployKey" + } + }, + "DeployKeyList": { + "description": "DeployKeyList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DeployKey" + } + } + }, + "EmailList": { + "description": "EmailList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Email" + } + } + }, + "EmptyRepository": { + "description": "EmptyRepository", + "schema": { + "$ref": "#/definitions/APIError" + } + }, + "FileDeleteResponse": { + "description": "FileDeleteResponse", + "schema": { + "$ref": "#/definitions/FileDeleteResponse" + } + }, + "FileResponse": { + "description": "FileResponse", + "schema": { + "$ref": "#/definitions/FileResponse" + } + }, + "GPGKey": { + "description": "GPGKey", + "schema": { + "$ref": "#/definitions/GPGKey" + } + }, + "GPGKeyList": { + "description": "GPGKeyList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/GPGKey" + } + } + }, + "GeneralAPISettings": { + "description": "GeneralAPISettings", + "schema": { + "$ref": "#/definitions/GeneralAPISettings" + } + }, + "GeneralAttachmentSettings": { + "description": "GeneralAttachmentSettings", + "schema": { + "$ref": "#/definitions/GeneralAttachmentSettings" + } + }, + "GeneralRepoSettings": { + "description": "GeneralRepoSettings", + "schema": { + "$ref": "#/definitions/GeneralRepoSettings" + } + }, + "GeneralUISettings": { + "description": "GeneralUISettings", + "schema": { + "$ref": "#/definitions/GeneralUISettings" + } + }, + "GitBlobResponse": { + "description": "GitBlobResponse", + "schema": { + "$ref": "#/definitions/GitBlobResponse" + } + }, + "GitHook": { + "description": "GitHook", + "schema": { + "$ref": "#/definitions/GitHook" + } + }, + "GitHookList": { + "description": "GitHookList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/GitHook" + } + } + }, + "GitTreeResponse": { + "description": "GitTreeResponse", + "schema": { + "$ref": "#/definitions/GitTreeResponse" + } + }, + "Hook": { + "description": "Hook", + "schema": { + "$ref": "#/definitions/Hook" + } + }, + "HookList": { + "description": "HookList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + } + } + }, + "Issue": { + "description": "Issue", + "schema": { + "$ref": "#/definitions/Issue" + } + }, + "IssueDeadline": { + "description": "IssueDeadline", + "schema": { + "$ref": "#/definitions/IssueDeadline" + } + }, + "IssueList": { + "description": "IssueList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Issue" + } + } + }, + "IssueTemplates": { + "description": "IssueTemplates", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/IssueTemplate" + } + } + }, + "Label": { + "description": "Label", + "schema": { + "$ref": "#/definitions/Label" + } + }, + "LabelList": { + "description": "LabelList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Label" + } + } + }, + "LanguageStatistics": { + "description": "LanguageStatistics", + "schema": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + } + } + }, + "MarkdownRender": { + "description": "MarkdownRender is a rendered markdown document", + "schema": { + "type": "string" + } + }, + "Milestone": { + "description": "Milestone", + "schema": { + "$ref": "#/definitions/Milestone" + } + }, + "MilestoneList": { + "description": "MilestoneList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Milestone" + } + } + }, + "NodeInfo": { + "description": "NodeInfo", + "schema": { + "$ref": "#/definitions/NodeInfo" + } + }, + "Note": { + "description": "Note", + "schema": { + "$ref": "#/definitions/Note" + } + }, + "NotificationCount": { + "description": "Number of unread notifications", + "schema": { + "$ref": "#/definitions/NotificationCount" + } + }, + "NotificationThread": { + "description": "NotificationThread", + "schema": { + "$ref": "#/definitions/NotificationThread" + } + }, + "NotificationThreadList": { + "description": "NotificationThreadList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/NotificationThread" + } + } + }, + "OAuth2Application": { + "description": "OAuth2Application", + "schema": { + "$ref": "#/definitions/OAuth2Application" + } + }, + "OAuth2ApplicationList": { + "description": "OAuth2ApplicationList represents a list of OAuth2 applications.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OAuth2Application" + } + } + }, + "Organization": { + "description": "Organization", + "schema": { + "$ref": "#/definitions/Organization" + } + }, + "OrganizationList": { + "description": "OrganizationList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Organization" + } + } + }, + "OrganizationPermissions": { + "description": "OrganizationPermissions", + "schema": { + "$ref": "#/definitions/OrganizationPermissions" + } + }, + "Package": { + "description": "Package", + "schema": { + "$ref": "#/definitions/Package" + } + }, + "PackageFileList": { + "description": "PackageFileList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageFile" + } + } + }, + "PackageList": { + "description": "PackageList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Package" + } + } + }, + "PublicKey": { + "description": "PublicKey", + "schema": { + "$ref": "#/definitions/PublicKey" + } + }, + "PublicKeyList": { + "description": "PublicKeyList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicKey" + } + } + }, + "PullRequest": { + "description": "PullRequest", + "schema": { + "$ref": "#/definitions/PullRequest" + } + }, + "PullRequestList": { + "description": "PullRequestList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/PullRequest" + } + } + }, + "PullReview": { + "description": "PullReview", + "schema": { + "$ref": "#/definitions/PullReview" + } + }, + "PullReviewComment": { + "description": "PullComment", + "schema": { + "$ref": "#/definitions/PullReviewComment" + } + }, + "PullReviewCommentList": { + "description": "PullCommentList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/PullReviewComment" + } + } + }, + "PullReviewList": { + "description": "PullReviewList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/PullReview" + } + } + }, + "PushMirror": { + "description": "PushMirror", + "schema": { + "$ref": "#/definitions/PushMirror" + } + }, + "PushMirrorList": { + "description": "PushMirrorList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/PushMirror" + } + } + }, + "Reaction": { + "description": "Reaction", + "schema": { + "$ref": "#/definitions/Reaction" + } + }, + "ReactionList": { + "description": "ReactionList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Reaction" + } + } + }, + "Reference": { + "description": "Reference", + "schema": { + "$ref": "#/definitions/Reference" + } + }, + "ReferenceList": { + "description": "ReferenceList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + } + } + }, + "Release": { + "description": "Release", + "schema": { + "$ref": "#/definitions/Release" + } + }, + "ReleaseList": { + "description": "ReleaseList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Release" + } + } + }, + "RepoCollaboratorPermission": { + "description": "RepoCollaboratorPermission", + "schema": { + "$ref": "#/definitions/RepoCollaboratorPermission" + } + }, + "Repository": { + "description": "Repository", + "schema": { + "$ref": "#/definitions/Repository" + } + }, + "RepositoryList": { + "description": "RepositoryList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Repository" + } + } + }, + "SearchResults": { + "description": "SearchResults", + "schema": { + "$ref": "#/definitions/SearchResults" + } + }, + "ServerVersion": { + "description": "ServerVersion", + "schema": { + "$ref": "#/definitions/ServerVersion" + } + }, + "StopWatch": { + "description": "StopWatch", + "schema": { + "$ref": "#/definitions/StopWatch" + } + }, + "StopWatchList": { + "description": "StopWatchList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/StopWatch" + } + } + }, + "StringSlice": { + "description": "StringSlice", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Tag": { + "description": "Tag", + "schema": { + "$ref": "#/definitions/Tag" + } + }, + "TagList": { + "description": "TagList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + } + }, + "Team": { + "description": "Team", + "schema": { + "$ref": "#/definitions/Team" + } + }, + "TeamList": { + "description": "TeamList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Team" + } + } + }, + "TimelineList": { + "description": "TimelineList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TimelineComment" + } + } + }, + "TopicListResponse": { + "description": "TopicListResponse", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TopicResponse" + } + } + }, + "TopicNames": { + "description": "TopicNames", + "schema": { + "$ref": "#/definitions/TopicName" + } + }, + "TrackedTime": { + "description": "TrackedTime", + "schema": { + "$ref": "#/definitions/TrackedTime" + } + }, + "TrackedTimeList": { + "description": "TrackedTimeList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TrackedTime" + } + } + }, + "User": { + "description": "User", + "schema": { + "$ref": "#/definitions/User" + } + }, + "UserHeatmapData": { + "description": "UserHeatmapData", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserHeatmapData" + } + } + }, + "UserList": { + "description": "UserList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + } + }, + "UserSettings": { + "description": "UserSettings", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserSettings" + } + } + }, + "WatchInfo": { + "description": "WatchInfo", + "schema": { + "$ref": "#/definitions/WatchInfo" + } + }, + "WikiCommitList": { + "description": "WikiCommitList", + "schema": { + "$ref": "#/definitions/WikiCommitList" + } + }, + "WikiPage": { + "description": "WikiPage", + "schema": { + "$ref": "#/definitions/WikiPage" + } + }, + "WikiPageList": { + "description": "WikiPageList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/WikiPageMetaData" + } + } + }, + "conflict": { + "description": "APIConflict is a conflict empty response" + }, + "empty": { + "description": "APIEmpty is an empty response" + }, + "error": { + "description": "APIError is error format response", + "headers": { + "message": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "forbidden": { + "description": "APIForbiddenError is a forbidden error response", + "headers": { + "message": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "invalidTopicsError": { + "description": "APIInvalidTopicsError is error format response to invalid topics", + "headers": { + "invalidTopics": { + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string" + } + } + }, + "notFound": { + "description": "APINotFound is a not found empty response" + }, + "parameterBodies": { + "description": "parameterBodies", + "schema": { + "$ref": "#/definitions/CreatePushMirrorOption" + } + }, + "redirect": { + "description": "APIRedirect is a redirect response" + }, + "string": { + "description": "APIString is a string response", + "schema": { + "type": "string" + } + }, + "validationError": { + "description": "APIValidationError is error format response related to input validation", + "headers": { + "message": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "AccessToken": { + "type": "apiKey", + "name": "access_token", + "in": "query" + }, + "AuthorizationHeaderToken": { + "description": "API tokens must be prepended with \"token\" followed by a space.", + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "BasicAuth": { + "type": "basic" + }, + "SudoHeader": { + "description": "Sudo API request as the user provided as the key. Admin privileges are required.", + "type": "apiKey", + "name": "Sudo", + "in": "header" + }, + "SudoParam": { + "description": "Sudo API request as the user provided as the key. Admin privileges are required.", + "type": "apiKey", + "name": "sudo", + "in": "query" + }, + "TOTPHeader": { + "description": "Must be used in combination with BasicAuth if two-factor authentication is enabled.", + "type": "apiKey", + "name": "X-GITEA-OTP", + "in": "header" + }, + "Token": { + "type": "apiKey", + "name": "token", + "in": "query" + } + }, + "security": [ + { + "BasicAuth": [] + }, + { + "Token": [] + }, + { + "AccessToken": [] + }, + { + "AuthorizationHeaderToken": [] + }, + { + "SudoParam": [] + }, + { + "SudoHeader": [] + }, + { + "TOTPHeader": [] + } + ] +} diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/List.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/List.fs new file mode 100644 index 0000000..53b9c3b --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/List.fs @@ -0,0 +1,13 @@ +namespace WoofWare.Whippet.Plugin.Swagger + +[] +module internal List = + + let allSome<'a> (l : 'a option list) : 'a list option = + let rec go acc (l : 'a option list) = + match l with + | [] -> Some (List.rev acc) + | None :: _ -> None + | Some head :: tail -> go (head :: acc) tail + + go [] l diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/README.md b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/README.md new file mode 100644 index 0000000..ec5dc48 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/README.md @@ -0,0 +1,108 @@ +# WoofWare.Whippet.Plugin.Swagger + +This is a [Whippet](https://github.com/Smaug123/WoofWare.Whippet) plugin for defining strongly-typed HTTP clients according to [Swagger](https://swagger.io/) schemas. + +It is a copy of the corresponding [Myriad](https://github.com/MoiraeSoftware/myriad) HttpClient plugin in [WoofWare.Myriad](https://github.com/Smaug123/WoofWare.Myriad), taken from commit d59ebdfccb87a06579fb99008a15f58ea8be394e. + +## Usage + +Save a Swagger schema as `my-swagger-schema.json`. + +In your `fsproj`: + +```xml + + + + + my-swagger-schema.json + GiteaClient + + + + + + + + + + + +``` + +(Note that you must supply `SomeClassName` to tell the generator what to name the type it produces.) + +The generator produces code like this. +Notice that it adds `JsonParse` and `JsonSerialize` attributes (i.e. it assumes you have access to [WoofWare.Whippet.Plugin.Json.Attributes](https://www.nuget.org/packages/WoofWare.Whippet.Plugin.Json.Attributes)), +and also the `HttpClient` attribute (i.e. it assumes you have access to [WoofWare.Whippet.Plugin.HttpClient.Attributes](https://www.nuget.org/packages/WoofWare.Whippet.Plugin.HttpClient.Attributes)). + +```fsharp +/// A type which was defined in the Swagger spec +[] +type SwaggerType1 = + { + [] + AdditionalProperties : System.Collections.Generic.Dictionary + Message : string + } + +/// Documentation from the Swagger spec +[] +type IGitea = + /// Returns the Person actor for a user + [] + abstract ActivitypubPerson : + [] username : string * ?ct : System.Threading.CancellationToken -> + ActivityPub System.Threading.Tasks.Task +``` + +That means if you choose to, you can chain other Whippet generators off this one, to generate JSON serde methods and HTTP REST clients: + +```xml + + + + + my-swagger-schema.json + GiteaClient + + + Client.fs + InterfaceMock + + + Client.fs + HttpClient + + JsonParseGenerator,JsonSourceGenerator + + + + + + + + + + + + + +``` + +The `` key tells us what to name the resulting interface (it gets an `I` prepended for you). + +### What's the point? + +[`SwaggerProvider`](https://github.com/fsprojects/SwaggerProvider) is *absolutely magical*, but it's kind of witchcraft. +I fear no man, but that thing… it scares me. + +Also, builds using `SwaggerProvider` appear to be inherently nondeterministic, even if the data source doesn't change. + +## Limitations + +Swagger API specs appear to be pretty cowboy in the wild. +I try to cope with invalid schemas I have seen, but I can't guarantee I do so correctly. +Definitely do perform integration tests and let me know of weird specs you encounter, and bits of the (very extensive) Swagger spec I have omitted! + +I have only attempted to deal with Swagger v2.0 so far. diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/Swagger.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/Swagger.fs new file mode 100644 index 0000000..15048c4 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/Swagger.fs @@ -0,0 +1,576 @@ +namespace WoofWare.Whippet.Plugin.Swagger + +open System +open System.Text.Json.Nodes + +[] +module internal JsonHelpers = + let inline asString (n : JsonNode) (key : string) : string = + match n.[key] with + | null -> failwith $"Expected node to have a key '%s{key}', but it did not: %s{n.ToJsonString ()}" + | s -> s.GetValue () + + [] + let inline asOpt<'ret> (n : JsonNode) (key : string) : 'ret option = + match n.[key] with + | null -> None + | s -> s.GetValue<'ret> () |> Some + + let inline asObj (n : JsonNode) (key : string) : JsonObject = + match n.[key] with + | null -> failwith $"Expected node to have a key '%s{key}', but it did not: %s{n.ToJsonString ()}" + | o -> o.AsObject () + + let inline asObjOpt (n : JsonNode) (key : string) : JsonObject option = + match n.[key] with + | null -> None + | o -> o.AsObject () |> Some + + let inline asArr (n : JsonNode) (key : string) : JsonArray = + match n.[key] with + | null -> failwith $"Expected node to have a key '%s{key}', but it did not: %s{n.ToJsonString ()}" + | o -> o.AsArray () + + let inline asArrOpt (n : JsonNode) (key : string) : JsonArray option = + match n.[key] with + | null -> None + | o -> o.AsArray () |> Some + + [] + let inline asArr'<'v> (n : JsonNode) (key : string) : 'v list = + match n.[key] with + | null -> failwith $"Expected node to have a key '%s{key}', but it did not: %s{n.ToJsonString ()}" + | o -> o.AsArray () |> Seq.map (fun v -> v.GetValue<'v> ()) |> Seq.toList + + [] + let inline asArrOpt'<'v> (n : JsonNode) (key : string) : 'v list option = + match n.[key] with + | null -> None + | o -> o.AsArray () |> Seq.map (fun v -> v.GetValue<'v> ()) |> Seq.toList |> Some + +/// A MIME type, like "application/json" +type MimeType = + /// A MIME type, like "application/json" + | MimeType of string + +/// A URL scheme, like "https" +type Scheme = + /// A URL scheme, like "https" + | Scheme of string + +/// "Licence information for the exposed API", whatever that means. +type SwaggerLicense = + { + /// "The license name used for the API", whatever that means. + Name : string + /// Link to the license used. Mutually exclusive with `Identifier`. + Url : Uri option + /// SPDX license identifier. Mutually exclusive with `Url`. + Identifier : string option + } + + /// Render a JsonObject into the strongly-typed version, performing sanity + /// checks and throwing on input that can't be parsed. + static member Parse (node : JsonObject) : SwaggerLicense = + let name = asString node "name" + let url = asOpt node "url" |> Option.map Uri + let identifier = asOpt node "identifier" + + match url, identifier with + | Some _, Some _ -> failwith "Invalid license spec: cannot supply both URL and identifier" + | _, _ -> () + + { + Name = name + Url = url + Identifier = identifier + } + +/// Overall information about the API described by this Swagger spec. +type SwaggerInfo = + { + /// Human-readable description of what this Swagger API is for. + /// Supports GitHub-flavoured markdown, apparently. + Description : string + /// Human-readable title of the service to which this is an API. + Title : string + /// The license applying to this schema. It's very unclear what this means. + /// The spec just says: + /// "Licence information for the exposed API" + License : SwaggerLicense + /// The version of this API (not the version of Swagger or the file defining the API!). + /// Strictly speaking this can be anything, but I am assuming it's roughly + /// SemVer. + Version : Version + } + + /// Render a JsonObject into the strongly-typed version, performing sanity + /// checks and throwing on input that can't be parsed. + static member Parse (node : JsonObject) : SwaggerInfo = + let description = asString node "description" + let title = asString node "title" + let version = asString node "version" |> Version.Parse + let license = asObj node "license" |> SwaggerLicense.Parse + + { + Description = description + Title = title + License = license + Version = version + } + +/// An "optional unique string used to describe an operation". +/// If present, these are assumed to be unique among all operations described +/// in the API. +type OperationId = + /// An "optional unique string used to describe an operation". + /// If present, these are assumed to be unique among all operations described + /// in the API. + | OperationId of string + + /// Round-trip string representation. + override this.ToString () = + match this with + | OperationId.OperationId s -> s + +/// Constraints on the `additionalProperties` (in the JSON schema sense). +/// "Additional properties" are properties of a JSON object which were not +/// listed in the schema. +type AdditionalProperties = + /// No additional properties are allowed: all properties must have been + /// mentioned in the schema. + | Never + /// Additional properties are permitted, but if they exist, they must + /// match this schema definition. + | Constrained of Definition + +/// The Swagger schema lets you define types. An ObjectTypeDefinition +/// is specifically the information about types defined as `"type": "object"`. +and ObjectTypeDefinition = + { + /// Human-readable description of the purpose of this type. + Description : string option + /// Fields which any object must have to satisfy this type. + Properties : Map option + /// Extra properties in the type description. In Gitea, these are + /// (for example) "x-go-package":"code.gitea.io/gitea/modules/structs". + Extras : Map + /// List of fields which are required; all other fields are optional. + Required : string list option + /// Constraints, if any, placed on fields which are not mentioned in + /// the schema. If absent, there are no constraints. + AdditionalProperties : AdditionalProperties option + /// Example of an object which satisfies this schema. + Example : JsonObject option + } + + /// Render a JsonObject into the strongly-typed version, performing sanity + /// checks and throwing on input that can't be parsed. + static member Parse (node : JsonObject) : ObjectTypeDefinition = + let description = + match asOpt node "description", asOpt node "title" with + | None, None -> None + | Some v, None + | None, Some v -> Some v + | Some v1, Some v2 -> failwith "both description and title were given" + + let additionalProperties = + match node.["additionalProperties"] with + | null -> None + | :? JsonValue as p -> + if not (p.GetValue ()) then + Some AdditionalProperties.Never + else + failwith $"additionalProperties should be 'false' or an object, but was: %s{p.ToJsonString ()}" + | p -> + let p = p.AsObject () + Definition.Parse p |> AdditionalProperties.Constrained |> Some + + let properties = + match node.["properties"] with + | null -> None + | p -> + p.AsObject () + |> Seq.map (fun (KeyValue (key, value)) -> + let value = value.AsObject () + key, Definition.Parse value + ) + |> Map.ofSeq + |> Some + + let example = asObjOpt node "example" + + let required = asArrOpt' node "required" + + let extras = + node.AsObject () + |> Seq.choose (fun (KeyValue (key, value)) -> + match key with + | "type" + | "description" + | "title" + | "additionalProperties" + | "example" + | "required" + | "properties" -> None + | _ -> Some (key, value) + ) + |> Map.ofSeq + + { + Description = description + Properties = properties + AdditionalProperties = additionalProperties + Required = required + Extras = extras + Example = example + } + +/// The Swagger schema lets you define types. An ArrayTypeDefinition +/// is specifically the information about types defined as `"type": "array"`. +and ArrayTypeDefinition = + { + /// The type is `'a array`; this field describes `'a`. + Items : Definition + } + + /// Render a JsonNode into the strongly-typed version, performing sanity + /// checks and throwing on input that can't be parsed. + static member Parse (n : JsonNode) : ArrayTypeDefinition = + let items = asObj n "items" |> Definition.Parse + + { + Items = items + } + +/// Any definition of a type in the Swagger document. This is basically any +/// information associated with the `"type": "blah"` field. +and Definition = + /// For example, if `"$ref": "#/responses/Blah", then this is "#/responses/Blah". + | Handle of string + /// A type definition with "type": "object". + | Object of ObjectTypeDefinition + /// A type definition with "type": "array". + | Array of ArrayTypeDefinition + /// A type definition with "type": "string". + | String + /// A type definition with "type": "boolean". + | Boolean + /// A response without a body has no "schema" specified. + | Unspecified + /// A type definition with "type": "integer". + /// The format is an optional hint which could be e.g. "int64" or "int32". + /// https://swagger.io/docs/specification/data-models/data-types/#numbers + | Integer of format : string option + /// Not a JSON schema type, but a Swagger 2.0 type. + | File + + /// Render a JsonObject into this strongly-typed specification. + static member Parse (n : JsonObject) : Definition = + match n.["$ref"] |> Option.ofObj with + | Some ref -> Definition.Handle (ref.GetValue ()) + | None -> + + let ty = asOpt n "type" + + match ty with + | None -> Definition.Unspecified + | Some "object" -> ObjectTypeDefinition.Parse n |> Definition.Object + | Some "array" -> ArrayTypeDefinition.Parse n |> Definition.Array + | Some "string" -> Definition.String + | Some "boolean" -> Definition.Boolean + | Some "file" -> Definition.File + | Some "integer" -> + let format = asOpt n "format" + Definition.Integer format + | Some ty -> failwith $"Unrecognised type: %s{ty}" + +/// REST APIs allow their parameters to be passed in various ways. This describes +/// how one single parameter is passed. +type ParameterIn = + /// The parameter is interpolated into the path, e.g. "/foo/{blah}". + /// The "name" is what we replace in the path: e.g. "/foo/{person}" would + /// have a name of "person". + | Path of name : string + /// The parameter is appended to the URL's query params, e.g. "?=blah" + | Query of name : string + /// The parameter is passed in the body of the HTTP request. + | Body + /// Some spec that WoofWare.Myriad doesn't support. + | Unrecognised of op : string * name : string + +/// Description of a single input parameter to an endpoint. +type SwaggerParameter = + { + /// The type schema to which this parameter must conform. + Type : Definition + /// Optional human-readable description of this parameter. + Description : string option + /// How this parameter is passed. + In : ParameterIn + /// Name of this parameter. For most `In` values, this name is the + /// name of the parameter as supplied to the API at runtime, and in WoofWare's + /// strongly-typed domain types this information is also contained in the `In` field. + /// For `Body` parameters, this is purely for dev-time information. + Name : string + /// Whether this parameter is required for validation to succeed. + /// I think this defaults to "no". + Required : bool option + } + + /// Render a JsonObject into this strongly-typed specification. + static member Parse (node : JsonObject) : SwaggerParameter = + let ty = + match asObjOpt node "schema" with + | None -> Definition.Parse node + | Some node -> Definition.Parse node + + let description = asOpt node "description" + let name = asString node "name" + + let paramIn = + match asString node "in" with + | "path" -> ParameterIn.Path name + | "query" -> ParameterIn.Query name + | "body" -> ParameterIn.Body + | f -> ParameterIn.Unrecognised (f, name) + + let required = asOpt node "required" + + { + Type = ty + Description = description + In = paramIn + Name = name + Required = required + } + +/// An "endpoint" is basically a single HTTP verb, applied to some path. +type SwaggerEndpoint = + { + /// The MIME types we should send our request body in. + /// This overrides (does not extend) any global definitions on the spec itself. + Consumes : MimeType list option + /// The MIME types we should expect to receive in response to this request. + /// This overrides (does not extend) any global definitions on the spec itself. + Produces : MimeType list option + /// Arbitrary list of [tags](https://swagger.io/docs/specification/2-0/grouping-operations-with-tags/). + Tags : string list + /// Human-readable description of the endpoint. + Summary : string + /// Arbitrary identifier of this endpoint; this must be unique across *all* endpoints + /// in this entire spec. + OperationId : OperationId + /// Parameters that must be supplied at HTTP-request-time to the endpoint. + /// (Each parameter knows how it needs to be supplied: e.g. if it's a query parameter or + /// if it's interpolated into the path.) + Parameters : SwaggerParameter list option + /// Map of HTTP response code to the type that we expect to receive in the body if we + /// get that response code back. + Responses : Map + } + + /// Render a JsonObject into this strongly-typed specification. + static member Parse (r : JsonObject) : SwaggerEndpoint = + let produces = asArrOpt' r "produces" |> Option.map (List.map MimeType) + let consumes = asArrOpt' r "consumes" |> Option.map (List.map MimeType) + let tags = asArr' r "tags" + let summary = asString r "summary" + let operationId = asString r "operationId" |> OperationId + + let responses = + asObj r "responses" + |> Seq.map (fun (KeyValue (key, value)) -> + let value = value.AsObject () + Int32.Parse key, Definition.Parse value + ) + |> Map.ofSeq + + let parameters = + asArrOpt r "parameters" + |> Option.map (fun pars -> + pars + |> Seq.map (fun par -> par.AsObject () |> SwaggerParameter.Parse) + |> Seq.toList + ) + + { + Produces = produces + Consumes = consumes + Tags = tags + Summary = summary + OperationId = operationId + Parameters = parameters + Responses = responses + } + +/// Specifies the form a response to an endpoint will take if it's complying with this spec. +type Response = + { + /// Human-readable description. + Description : string + /// Specification of the type to which responses will conform under this spec. + Schema : Definition + } + + /// Render a JsonObject into this strongly-typed specification. + static member Parse (r : JsonObject) : Response = + let desc = asString r "description" + + let schema = + match asObjOpt r "schema" with + | None -> Definition.Unspecified + | Some s -> Definition.Parse s + + { + Description = desc + Schema = schema + } + +/// An HTTP method. This is System.Net.Http.HttpMethod, but +/// a proper discriminated union. +type HttpMethod = + /// HTTP Get + | Get + /// HTTP Post + | Post + /// HTTP Delete + | Delete + /// HTTP Patch + | Patch + /// HTTP Options + | Options + /// HTTP Head + | Head + /// HTTP Put + | Put + /// HTTP Trace + | Trace + + /// Convert to the standard library's enum type. + member this.ToDotNet () : System.Net.Http.HttpMethod = + match this with + | HttpMethod.Get -> System.Net.Http.HttpMethod.Get + | HttpMethod.Post -> System.Net.Http.HttpMethod.Post + | HttpMethod.Delete -> System.Net.Http.HttpMethod.Delete + | HttpMethod.Patch -> System.Net.Http.HttpMethod.Patch + | HttpMethod.Options -> System.Net.Http.HttpMethod.Options + | HttpMethod.Head -> System.Net.Http.HttpMethod.Head + | HttpMethod.Put -> System.Net.Http.HttpMethod.Put + | HttpMethod.Trace -> System.Net.Http.HttpMethod.Trace + + /// Human-readable string representation. + override this.ToString () : string = + match this with + | HttpMethod.Get -> "Get" + | HttpMethod.Post -> "Post" + | HttpMethod.Delete -> "Delete" + | HttpMethod.Patch -> "Post" + | HttpMethod.Options -> "Options" + | HttpMethod.Head -> "Head" + | HttpMethod.Put -> "Put" + | HttpMethod.Trace -> "Trace" + + /// Throws on invalid inputs. + static member Parse (s : string) : HttpMethod = + if String.Equals (s, "get", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Get + elif String.Equals (s, "post", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Post + elif String.Equals (s, "patch", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Patch + elif String.Equals (s, "delete", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Delete + elif String.Equals (s, "head", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Head + elif String.Equals (s, "options", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Options + elif String.Equals (s, "put", StringComparison.OrdinalIgnoreCase) then + HttpMethod.Put + else + failwith $"Unrecognised method: %s{s}" + +/// A Swagger API specification. +type Swagger = + { + /// Global collection of MIME types which any endpoint expects to consume its inputs in. + /// This may be overridden on any individual endpoint by that endpoint. + Consumes : MimeType list + /// Global collection of MIME types which any endpoint will produce. + /// This may be overridden on any individual endpoint by that endpoint. + Produces : MimeType list + /// HTTP or HTTPS, for example. Indicates which scheme to access the API on. + Schemes : Scheme list + /// The version of OpenAPI this specification is written against. + /// (As of this writing, we only support 2.0.) + Swagger : Version + /// General information about this API. + Info : SwaggerInfo + /// Path under the URI host, which should be prefixed (with trailing slash if necessary) + /// to all requests. + BasePath : string + /// Map from relative path to "what is served at that path". + Paths : Map> + /// Types defined in the schema. Requests may use these definitions just like in any other JSON schema. + /// Key is a domain type name, e.g. "APIError". + Definitions : Map + /// Types of each response. + /// Key is a domain type name, e.g. "AccessToken". + Responses : Map + } + +[] +module Swagger = + /// Parse a JSON-schema-based specification of a Swagger 2.0 API and + /// build the strongly-typed version. Throws on invalid inputs. + let parse (s : string) : Swagger = + let node = JsonNode.Parse s + let consumes = asArr' node "consumes" |> List.map MimeType + let produces = asArr' node "produces" |> List.map MimeType + let schemes = asArr' node "schemes" |> List.map Scheme + let swagger = asString node "swagger" |> Version.Parse + let info = asObj node "info" |> SwaggerInfo.Parse + let basePath = asString node "basePath" + + let definitions = + asObj node "definitions" + |> Seq.map (fun (KeyValue (key, value)) -> + let value = value.AsObject () + key, Definition.Parse value + ) + |> Map.ofSeq + + let paths = + asObj node "paths" + |> Seq.map (fun (KeyValue (key, value)) -> + let contents = + value.AsObject () + |> Seq.map (fun (KeyValue (endpoint, contents)) -> + let contents = contents.AsObject () + HttpMethod.Parse endpoint, SwaggerEndpoint.Parse contents + ) + |> Map.ofSeq + + key, contents + ) + |> Map.ofSeq + + let responses = + asObj node "responses" + |> Seq.map (fun (KeyValue (key, value)) -> + let value = value.AsObject () + key, Response.Parse value + ) + |> Map.ofSeq + + { + Consumes = consumes + Produces = produces + Schemes = schemes + Swagger = swagger + Info = info + BasePath = basePath + Paths = paths + Definitions = definitions + Responses = responses + } diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/SwaggerClientGenerator.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/SwaggerClientGenerator.fs new file mode 100644 index 0000000..9ccd7c0 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/SwaggerClientGenerator.fs @@ -0,0 +1,709 @@ +namespace WoofWare.Whippet.Plugin.Swagger + +open System +open System.Collections.Generic +open System.IO +open System.Text +open System.Threading +open Fantomas.FCS.Syntax +open Fantomas.FCS.Xml +open WoofWare.Whippet.Core +open WoofWare.Whippet.Fantomas +open Fantomas.FCS.Text.Range + +type internal SwaggerClientConfig = + { + ClassName : string + } + +type internal Produces = + // TODO: this will cope with decoding JSON, plain text, etc + | Produces of string + +type internal Endpoint = + { + DocString : PreXmlDoc + Produces : Produces + ReturnType : Definition + Method : HttpMethod + Operation : OperationId + Parameters : SwaggerParameter list + Endpoint : string + } + +type internal TypeEntry = + { + /// If we had to define a type for this, here it is. + FSharpDefinition : SynTypeDefn option + /// SynType you use in e.g. a type annotation to refer to this type in F# code. + Signature : SynType + } + +type internal Types = + { + ByHandle : IReadOnlyDictionary + ByDefinition : IReadOnlyDictionary + } + +[] +module internal SwaggerClientGenerator = + let outputFile = FileInfo "/tmp/output.txt" + + // do + // use _ = File.Create outputFile.FullName + // () + + let log (line : string) = + // use w = outputFile.AppendText () + // w.WriteLine line + () + + let renderType (types : Types) (defn : Definition) : SynType option = + match types.ByDefinition.TryGetValue defn with + | true, v -> Some v.Signature + | false, _ -> + + match defn with + | Definition.Handle h -> + match types.ByHandle.TryGetValue h with + | false, _ -> None + | true, v -> Some v.Signature + | Definition.Object _ -> failwith "should not hit" + | Definition.Array _ -> failwith "should not hit" + | Definition.Unspecified -> failwith "should not hit" + | Definition.String -> SynType.string |> Some + | Definition.Boolean -> SynType.bool |> Some + | Definition.Integer _ -> SynType.int |> Some + | Definition.File -> SynType.createLongIdent' [ "System" ; "IO" ; "Stream" ] |> Some + + /// Returns None if we lacked the information required to do this. + /// bigCache is a map of e.g. {"securityDefinition": {Defn : F# type}}. + let rec defnToType + (anonymousTypeCount : int ref) + (handlesMap : Dictionary) + (bigCache : Dictionary>) + (thisKey : string) + (typeName : string option) + (d : Definition) + : TypeEntry option + = + let cache = + match bigCache.TryGetValue thisKey with + | false, _ -> + let d = Dictionary () + bigCache.Add (thisKey, d) + d + | true, d -> d + + let handleKey = + match typeName with + | None -> None + | Some typeName -> $"#/%s{thisKey}/%s{typeName}" |> Some + + match handleKey with + | Some hk when handlesMap.ContainsKey hk -> + let result = handlesMap.[hk] + cache.[d] <- result + Some result + + | _ -> + + match cache.TryGetValue d with + | true, v -> + match handleKey with + | None -> () + | Some key -> handlesMap.Add (key, v) + + Some v + | false, _ -> + + let result = + match d with + | Definition.Object obj -> + let requiredFields = obj.Required |> Option.defaultValue [] |> Set.ofList + + let namedProperties = + obj.Properties + |> Option.map Seq.cast + |> Option.defaultValue Seq.empty + |> Seq.map (fun (KeyValue (fieldName, defn)) -> + // TODO this is a horrible hack and is incomplete, e.g. if we contain an array of ourself + // Special case for when this is a reference to this very type + let isOurself = + match defn with + | Definition.Handle h -> + match h.Split '/' with + | [| "#" ; location ; ty |] when location = thisKey && Some ty = typeName -> + SynType.named ty |> Some + | _ -> None + | _ -> None + + let jsonPropertyName = + SynExpr.CreateConst (fieldName : string) + |> SynAttribute.create ( + SynLongIdent.createS' + [ "System" ; "Text" ; "Json" ; "Serialization" ; "JsonPropertyName" ] + ) + + match isOurself with + | Some alreadyDone -> + let ty = + if Set.contains fieldName requiredFields then + alreadyDone + else + SynType.option alreadyDone + + { + Attrs = [ jsonPropertyName ] + Type = ty + Ident = Some (Ident.createSanitisedTypeName fieldName) + } + |> SynField.make + |> Some + | None -> + + let defn' = defnToType anonymousTypeCount handlesMap bigCache thisKey None defn + + match defn' with + | None -> None + | Some defn' -> + let ty = + if Set.contains fieldName requiredFields then + defn'.Signature + else + defn'.Signature |> SynType.option + + { + Attrs = [ jsonPropertyName ] + Ident = Ident.createSanitisedTypeName fieldName |> Some + Type = ty + } + |> SynField.make + |> Some + ) + |> Seq.toList + + let additionalProperties = + match obj.AdditionalProperties with + | None -> + { + Attrs = + [ + SynAttribute.create + (SynLongIdent.createS' + [ "System" ; "Text" ; "Json" ; "Serialization" ; "JsonExtensionData" ]) + (SynExpr.CreateConst ()) + ] + Ident = Ident.create "AdditionalProperties" |> Some + Type = + SynType.app' + (SynType.createLongIdent' [ "System" ; "Collections" ; "Generic" ; "Dictionary" ]) + [ + SynType.string + SynType.createLongIdent' [ "System" ; "Text" ; "Json" ; "Nodes" ; "JsonNode" ] + ] + } + |> SynField.make + |> List.singleton + |> Some + | Some AdditionalProperties.Never -> Some [] + | Some (AdditionalProperties.Constrained defn) -> + let defn' = defnToType anonymousTypeCount handlesMap bigCache thisKey None defn + + match defn' with + | None -> None + | Some defn' -> + { + Attrs = + [ + SynAttribute.create + (SynLongIdent.createS' + [ "System" ; "Text" ; "Json" ; "Serialization" ; "JsonExtensionData" ]) + (SynExpr.CreateConst ()) + ] + Ident = Ident.create "AdditionalProperties" |> Some + Type = + SynType.app' + (SynType.createLongIdent' + [ "System" ; "Collections" ; "Generic" ; "Dictionary" ]) + [ SynType.string ; defn'.Signature ] + } + |> SynField.make + |> List.singleton + |> Some + + match additionalProperties with + | None -> None + | Some additionalProperties -> + + match List.allSome namedProperties with + | None -> None + | Some namedProperties -> + + let fSharpTypeName = + match typeName with + | None -> $"Type%i{Interlocked.Increment anonymousTypeCount}" + | Some typeName -> typeName + + let properties = additionalProperties @ namedProperties + + let properties = + if properties.IsEmpty then + // sigh, they didn't give us any properties at all; let's make one up + { + Attrs = [] + Ident = Some (Ident.create "_SchemaUnspecified") + Type = SynType.obj + } + |> SynField.make + |> List.singleton + else + properties + + let defn = + let sci = + SynComponentInfo.create (Ident.createSanitisedTypeName fSharpTypeName) + |> SynComponentInfo.addAttributes + [ + SynAttribute.create (SynLongIdent.createS' [ "JsonParse" ]) (SynExpr.CreateConst true) + SynAttribute.create + (SynLongIdent.createS' [ "JsonSerialize" ]) + (SynExpr.CreateConst true) + ] + |> fun sci -> + match obj.Description with + | None -> sci + | Some doc -> sci |> SynComponentInfo.withDocString (PreXmlDoc.create doc) + + properties |> SynTypeDefnRepr.record |> SynTypeDefn.create sci + + let defn = + { + Signature = SynType.named fSharpTypeName + FSharpDefinition = Some defn + } + + defn |> Some + + | Definition.Array elt -> + let child = defnToType anonymousTypeCount handlesMap bigCache thisKey None elt.Items + + match child with + | None -> None + | Some child -> + let defn = + { + Signature = SynType.list child.Signature + FSharpDefinition = None + } + + Some defn + | Definition.String -> + { + Signature = SynType.string + FSharpDefinition = None + } + |> Some + | Definition.Boolean -> + { + Signature = SynType.bool + FSharpDefinition = None + } + |> Some + | Definition.Unspecified -> + { + Signature = SynType.unit + FSharpDefinition = None + } + |> Some + | Definition.Integer _ -> + { + Signature = SynType.createLongIdent' [ "int" ] + FSharpDefinition = None + } + |> Some + | Definition.File -> + { + Signature = SynType.createLongIdent' [ "System" ; "IO" ; "Stream" ] + FSharpDefinition = None + } + |> Some + | Definition.Handle s -> + let split = s.Split '/' |> List.ofArray + + match split with + | [ "#" ; _location ; _handle ] -> + match handlesMap.TryGetValue s with + | false, _ -> None + | true, computed -> + let defn = + { + FSharpDefinition = None + Signature = computed.Signature + } + + defn |> Some + | _ -> failwith $"we don't know how to deal with object handle %s{s}" + + match result with + | None -> None + | Some result -> + + match handleKey with + | None -> () + | Some handleKey -> handlesMap.Add (handleKey, result) + + cache.Add (d, result) + Some result + + let instantiateRequiredTypes (types : Types) : SynModuleDecl = + types.ByDefinition + |> Seq.choose (fun (KeyValue (_defn, typeEntry)) -> typeEntry.FSharpDefinition) + |> Seq.toList + |> SynModuleDecl.createTypes + + type private IsIn = + | Path of str : string + | Query of str : string + | Body + + let computeType + (options : SwaggerClientConfig) + (basePath : string) + (types : Types) + (clientDocString : PreXmlDoc) + (endpoints : Endpoint list) + : SynModuleDecl list + = + endpoints + |> List.choose (fun ep -> + let name = (Ident.createSanitisedTypeName (ep.Operation.ToString ())).idText + + match renderType types ep.ReturnType with + | None -> + log $"Skipping %O{ep.Operation}: Couldn't render return type: %O{ep.ReturnType}" + None + | Some returnType -> + + let pars = + ep.Parameters + |> List.map (fun par -> + let inParam = + match par.In with + | ParameterIn.Unrecognised (f, name) -> + log + $"Skipping %O{ep.Operation} at %s{ep.Endpoint}: unrecognised In parameter %s{f} with name %s{name}" + + None + | ParameterIn.Body -> Some IsIn.Body + | ParameterIn.Query name -> Some (IsIn.Query name) + | ParameterIn.Path name -> Some (IsIn.Path name) + + match inParam with + | None -> None + | Some inParam -> + + match renderType types par.Type with + | None -> + // Couldn't render the return type + // failwith "Did not have a type here" + log $"Skipping %O{ep.Operation}: Couldn't render parameter: %O{par.Type}" + None + | Some v -> Some (Ident.createSanitisedParamName par.Name, inParam, v) + ) + |> List.allSome + + match pars with + | None -> None + | Some pars -> + + let arity = + SynValInfo.SynValInfo ( + [ + ep.Parameters + |> List.map (fun par -> + let name = par.Name |> Ident.create |> Some + SynArgInfo.SynArgInfo ([], false, name) + ) + |> fun l -> l @ [ SynArgInfo.SynArgInfo ([], true, Some (Ident.create "ct")) ] + ], + SynArgInfo.SynArgInfo ([], false, None) + ) + + let domain = + let ctParam = + SynType.signatureParamOfType + [] + (SynType.createLongIdent' [ "System" ; "Threading" ; "CancellationToken" ]) + true + (Some (Ident.create "ct")) + + let argParams = + pars + |> List.map (fun (ident, isIn, t) -> + let attr : SynAttribute list = + match isIn with + | IsIn.Path name -> + SynAttribute.create + (SynLongIdent.createS' [ "RestEase" ; "Path" ]) + (SynExpr.CreateConst name) + |> List.singleton + | IsIn.Query name -> + SynAttribute.create + (SynLongIdent.createS' [ "RestEase" ; "Query" ]) + (SynExpr.CreateConst name) + |> List.singleton + | IsIn.Body -> + SynAttribute.create + (SynLongIdent.createS' [ "RestEase" ; "Body" ]) + (SynExpr.CreateConst ()) + |> List.singleton + + SynType.signatureParamOfType attr t false (Some ident) + ) + + SynType.tupleNoParen (argParams @ [ ctParam ]) |> Option.get + + let attrs = + [ + SynAttribute.create + (SynLongIdent.createS' [ "RestEase" ; ep.Method.ToString () ]) + // Gitea, at least, starts with a `/`, which `Uri` then takes to indicate an absolute path. + (SynExpr.CreateConst (ep.Endpoint.TrimStart '/')) + + match ep.Produces with + | Produces.Produces contentType -> + SynAttribute.create + (SynLongIdent.createS' [ "RestEase" ; "Header" ]) + // Gitea, at least, starts with a `/`, which `Uri` then takes to indicate an absolute path. + (SynExpr.tuple [ SynExpr.CreateConst "Content-Type" ; SynExpr.CreateConst contentType ]) + ] + + returnType + |> SynType.task + |> SynType.toFun [ domain ] + |> SynMemberDefn.abstractMember attrs (SynIdent.createS name) None arity ep.DocString + |> Some + ) + |> SynTypeDefnRepr.interfaceType + |> SynTypeDefn.create ( + let attrs = + [ + yield + SynAttribute.create + (SynLongIdent.createS' [ "RestEase" ; "BasePath" ]) + (SynExpr.CreateConst basePath) + ] + + SynComponentInfo.create (Ident.create ("I" + options.ClassName)) + |> SynComponentInfo.withDocString clientDocString + |> SynComponentInfo.addAttributes attrs + ) + |> List.singleton + |> SynModuleDecl.createTypes + |> List.singleton + +/// Whippet generator that stamps out an interface and class to access a Swagger-specified API. +[] +type SwaggerClientGenerator () = + + interface IGenerateRawFromRaw with + member _.GenerateRawFromRaw (context : RawSourceGenerationArgs) = + if not (context.FilePath.EndsWith (".json", StringComparison.Ordinal)) then + null + else + + let contents = Encoding.UTF8.GetString context.FileContents |> Swagger.parse + + let scheme = + let preferred = Scheme "https" + + if List.isEmpty contents.Schemes then + failwith "no schemes specified in API spec!" + + if List.contains preferred contents.Schemes then + preferred + else + List.head contents.Schemes + + let clientDocstring = contents.Info.Description |> PreXmlDoc.create + + let basePath = contents.BasePath + + let typeDefs = + let bigCache = Dictionary<_, Dictionary<_, _>> () + + let countAll () = + (0, bigCache) ||> Seq.fold (fun count (KeyValue (_, v)) -> count + v.Count) + + let byHandle = Dictionary () + let anonymousTypeCount = ref 0 + + let rec go (contents : ((string * Definition) * string) list) = + let lastRound = countAll () + + contents + |> List.filter (fun ((name, defn), defnClass) -> + let doIt = + SwaggerClientGenerator.defnToType + anonymousTypeCount + byHandle + bigCache + defnClass + (Some name) + defn + + match doIt with + | None -> true + | Some _ -> false + ) + |> fun remaining -> + if not remaining.IsEmpty then + let currentCount = countAll () + + if currentCount = lastRound then + for (name, remaining), kind in remaining do + SwaggerClientGenerator.log $"Remaining: %s{name} (%s{kind})" + + SwaggerClientGenerator.log "--------" + + for KeyValue (handle, defn) in byHandle do + SwaggerClientGenerator.log $"Known: %s{handle} %O{defn}" + + // TODO: ohh noooooo the Gitea spec is genuinely circular, + // it's impossible to construct a Repository type + // we're going to have to somehow detect this case and break the cycle + // by artificially making a property optional + // :sob: Gitea why are you like this + // failwith "Made no further progress rendering types" + () + else + go remaining + + seq { + for defnClass in [ "definitions" ; "responses" ] do + match defnClass with + | "definitions" -> + for KeyValue (k, v) in contents.Definitions do + yield (k, v), defnClass + | "responses" -> + for KeyValue (k, v) in contents.Responses do + yield (k, v.Schema), defnClass + | _ -> failwith "oh no" + } + |> Seq.toList + |> go + + let result = Dictionary () + + for KeyValue (_container, types) in bigCache do + for KeyValue (defn, rendered) in types do + result.TryAdd (defn, rendered) |> ignore + + { + ByHandle = byHandle + ByDefinition = result :> IReadOnlyDictionary<_, _> + } + + let summary = + contents.Paths + |> Seq.collect (fun (KeyValue (path, endpoints)) -> + endpoints + |> Seq.choose (fun (KeyValue (method, endpoint)) -> + let docstring = endpoint.Summary |> PreXmlDoc.create + + let produces = + match endpoint.Produces with + | None -> Produces "json" + | Some [] -> failwith $"API specified empty Produces: %s{path} (%O{method})" + | Some [ MimeType "application/json" ] -> Produces "json" + | Some [ MimeType (StartsWith "text/" t) ] -> Produces t + | Some [ MimeType s ] -> + failwithf + $"we don't support non-JSON Produces right now, got: %s{s} (%s{path} %O{method})" + | Some (_ :: _) -> + failwith $"we don't support multiple Produces right now, at %s{path} (%O{method})" + + let returnType = + endpoint.Responses + |> Seq.choose (fun (KeyValue (response, defn)) -> + if 200 <= response && response < 300 then + Some defn + else + None + ) + |> Seq.toList + + let returnType = + match returnType with + | [ t ] -> Some t + | [] -> failwith $"got no successful response results, %s{path} %O{method}" + | _ -> + SwaggerClientGenerator.log + $"Ignoring %s{path} %O{method} due to multiple success responses" + // can't be bothered to work out how to deal with multiple success + // results right now + None + + match returnType with + | None -> None + | Some returnType -> + + { + Method = method + Produces = produces + DocString = docstring + ReturnType = returnType + Operation = endpoint.OperationId + Parameters = endpoint.Parameters |> Option.defaultValue [] + Endpoint = path + } + |> Some + ) + |> Seq.toList + ) + |> Seq.toList + + let config = + let pars = + context.Parameters + |> Seq.map (fun (KeyValue (k, v)) -> k.ToUpperInvariant (), v) + |> Map.ofSeq + + if pars.IsEmpty then + failwith "No parameters given. You must supply the parameter." + + let className = + match Map.tryFind "CLASSNAME" pars with + | None -> failwith "You must supply the parameter." + | Some v -> v + + { + ClassName = className + } + + let ty = + SwaggerClientGenerator.computeType config basePath typeDefs clientDocstring summary + + [ + yield + SynModuleDecl.openAny ( + SynOpenDeclTarget.ModuleOrNamespace ( + SynLongIdent.createS' [ "WoofWare" ; "Whippet" ; "Plugin" ; "Json" ], + range0 + ) + ) + yield + SynModuleDecl.openAny ( + SynOpenDeclTarget.ModuleOrNamespace ( + SynLongIdent.createS' [ "WoofWare" ; "Whippet" ; "Plugin" ; "HttpClient" ], + range0 + ) + ) + yield SwaggerClientGenerator.instantiateRequiredTypes typeDefs + yield! ty + ] + |> SynModuleOrNamespace.createNamespace [ Ident.create config.ClassName ] + |> List.singleton + |> Ast.render + |> Option.toObj diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/Text.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/Text.fs new file mode 100644 index 0000000..92d73ec --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/Text.fs @@ -0,0 +1,11 @@ +namespace WoofWare.Whippet.Plugin.Swagger + +open System + +[] +module internal Text = + let (|StartsWith|_|) (prefix : string) (s : string) : string option = + if s.StartsWith (prefix, StringComparison.Ordinal) then + Some (s.Substring prefix.Length) + else + None diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.Test/TestSwaggerParse.fs b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.Test/TestSwaggerParse.fs new file mode 100644 index 0000000..6f42246 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.Test/TestSwaggerParse.fs @@ -0,0 +1,84 @@ +namespace WoofWare.Whippet.Plugin.Swagger.Test + +open System.Text.Json.Nodes +open NUnit.Framework +open FsUnitTyped +open WoofWare.Whippet.Plugin.Swagger + +[] +module TestSwaggerParse = + [] + let ``Can parse parameters`` () : unit = + let s = + """{ + "tags": [ + "organization" + ], + "summary": "Check if a user is a member of an organization", + "operationId": "orgIsMember", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "user is a member" + }, + "303": { + "description": "redirection to /orgs/{org}/public_members/{username}" + }, + "404": { + "description": "user is not a member" + } + } +} +""" + |> JsonNode.Parse + + s.AsObject () + |> SwaggerEndpoint.Parse + |> shouldEqual + { + Consumes = None + Produces = None + Tags = [ "organization" ] + Summary = "Check if a user is a member of an organization" + OperationId = OperationId "orgIsMember" + Parameters = + [ + { + Type = Definition.String + Description = Some "name of the organization" + Name = "org" + In = ParameterIn.Path "org" + Required = Some true + } + { + Type = Definition.String + Description = Some "username of the user" + Name = "username" + In = ParameterIn.Path "username" + Required = Some true + } + ] + |> Some + Responses = + [ + 204, Definition.Unspecified + 303, Definition.Unspecified + 404, Definition.Unspecified + ] + |> Map.ofList + } diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.Test/WoofWare.Whippet.Plugin.Swagger.Test.fsproj b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.Test/WoofWare.Whippet.Plugin.Swagger.Test.fsproj new file mode 100644 index 0000000..8f8c28b --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.Test/WoofWare.Whippet.Plugin.Swagger.Test.fsproj @@ -0,0 +1,25 @@ + + + + net8.0 + false + true + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.fsproj b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.fsproj new file mode 100644 index 0000000..88ba37c --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/WoofWare.Whippet.Plugin.Swagger.fsproj @@ -0,0 +1,44 @@ + + + + netstandard2.1 + true + Patrick Stevens + Copyright (c) Patrick Stevens 2024 + Whippet F# source generator plugin, for generating Swagger clients. + git + https://github.com/Smaug123/WoofWare.Whippet + MIT + README.md + fsharp;source-generator;source-gen;whippet;swagger + true + FS3559 + WoofWare.Whippet.Plugin.Swagger + true + true + NU5118 + + + + + + + + + + True + / + README.md + + + + + + + + + + + + + diff --git a/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/version.json b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/version.json new file mode 100644 index 0000000..41c1bb2 --- /dev/null +++ b/Plugins/Swagger/WoofWare.Whippet.Plugin.Swagger/version.json @@ -0,0 +1,13 @@ +{ + "version": "0.1", + "publicReleaseRefSpec": [ + "^refs/heads/main$" + ], + "pathFilters": [ + "./", + ":/WoofWare.Whippet.Core/", + ":/WoofWare.Whippet.Fantomas/", + ":/global.json", + ":/Directory.Build.props" + ] +} diff --git a/WoofWare.Whippet.sln b/WoofWare.Whippet.sln index b663186..692b48c 100644 --- a/WoofWare.Whippet.sln +++ b/WoofWare.Whippet.sln @@ -42,7 +42,13 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.Int EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.InterfaceMock.Test", "Plugins\InterfaceMock\WoofWare.Whippet.Plugin.InterfaceMock\WoofWare.Whippet.Plugin.InterfaceMock.Test\WoofWare.Whippet.Plugin.InterfaceMock.Test.fsproj", "{1B0D4C01-66CD-4E91-9DA5-9ED4F3319AFA}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.InterfaceMock.Attributes", "Plugins\InterfaceMock\WoofWare.Whippet.Plugin.InterfaceMock.Attributes\WoofWare.Whippet.Plugin.InterfaceMock.Attributes.fsproj", "{E73EA066-2725-42CD-BE7D-39264C24AA97}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.Swagger", "Plugins\Swagger\WoofWare.Whippet.Plugin.Swagger\WoofWare.Whippet.Plugin.Swagger.fsproj", "{114895ED-FE7A-498B-9F60-FECA85A88422}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.Swagger.Consumer", "Plugins\Swagger\WoofWare.Whippet.Plugin.Swagger.Consumer\WoofWare.Whippet.Plugin.Swagger.Consumer.fsproj", "{0E6A57A6-FCB5-4D57-8C4B-9081D347028C}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.Swagger.Test", "Plugins\Swagger\WoofWare.Whippet.Plugin.Swagger\WoofWare.Whippet.Plugin.Swagger.Test\WoofWare.Whippet.Plugin.Swagger.Test.fsproj", "{320D227C-6C26-4B62-8DD4-0EA420C36D7E}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WoofWare.Whippet.Plugin.InterfaceMock.Attributes", "Plugins\InterfaceMock\WoofWare.Whippet.Plugin.InterfaceMock.Attributes\WoofWare.Whippet.Plugin.InterfaceMock.Attributes.fsproj", "{A3DCC00E-AA51-408B-93C3-5F227CFFCBD3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -134,9 +140,21 @@ Global {1B0D4C01-66CD-4E91-9DA5-9ED4F3319AFA}.Debug|Any CPU.Build.0 = Debug|Any CPU {1B0D4C01-66CD-4E91-9DA5-9ED4F3319AFA}.Release|Any CPU.ActiveCfg = Release|Any CPU {1B0D4C01-66CD-4E91-9DA5-9ED4F3319AFA}.Release|Any CPU.Build.0 = Release|Any CPU - {E73EA066-2725-42CD-BE7D-39264C24AA97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E73EA066-2725-42CD-BE7D-39264C24AA97}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E73EA066-2725-42CD-BE7D-39264C24AA97}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E73EA066-2725-42CD-BE7D-39264C24AA97}.Release|Any CPU.Build.0 = Release|Any CPU + {114895ED-FE7A-498B-9F60-FECA85A88422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {114895ED-FE7A-498B-9F60-FECA85A88422}.Debug|Any CPU.Build.0 = Debug|Any CPU + {114895ED-FE7A-498B-9F60-FECA85A88422}.Release|Any CPU.ActiveCfg = Release|Any CPU + {114895ED-FE7A-498B-9F60-FECA85A88422}.Release|Any CPU.Build.0 = Release|Any CPU + {0E6A57A6-FCB5-4D57-8C4B-9081D347028C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E6A57A6-FCB5-4D57-8C4B-9081D347028C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E6A57A6-FCB5-4D57-8C4B-9081D347028C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E6A57A6-FCB5-4D57-8C4B-9081D347028C}.Release|Any CPU.Build.0 = Release|Any CPU + {320D227C-6C26-4B62-8DD4-0EA420C36D7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {320D227C-6C26-4B62-8DD4-0EA420C36D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {320D227C-6C26-4B62-8DD4-0EA420C36D7E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {320D227C-6C26-4B62-8DD4-0EA420C36D7E}.Release|Any CPU.Build.0 = Release|Any CPU + {A3DCC00E-AA51-408B-93C3-5F227CFFCBD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3DCC00E-AA51-408B-93C3-5F227CFFCBD3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3DCC00E-AA51-408B-93C3-5F227CFFCBD3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3DCC00E-AA51-408B-93C3-5F227CFFCBD3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal