mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-06 08:26:41 -04:00
9e031eb3df
Add a build-time conversion step that transforms the existing Swagger 2.0 spec into an OpenAPI 3.0 spec. The OAS3 spec is served alongside the existing Swagger 2.0 spec, enabling API clients that require OAS3 to generate code directly from Gitea's API. This is not to be an answer to how gitea handles OAS3 long term, but a way to use what we have to move a step forward. --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
94 lines
3.7 KiB
Go
94 lines
3.7 KiB
Go
// Copyright 2015 The Gogs Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package structs
|
|
|
|
// Organization represents an organization
|
|
type Organization struct {
|
|
// The unique identifier of the organization
|
|
ID int64 `json:"id"`
|
|
// The name of the organization
|
|
Name string `json:"name"`
|
|
// The full display name of the organization
|
|
FullName string `json:"full_name"`
|
|
// The email address of the organization
|
|
Email string `json:"email"`
|
|
// The URL of the organization's avatar
|
|
AvatarURL string `json:"avatar_url"`
|
|
// The description of the organization
|
|
Description string `json:"description"`
|
|
// The website URL of the organization
|
|
Website string `json:"website"`
|
|
// The location of the organization
|
|
Location string `json:"location"`
|
|
// The visibility level of the organization (public, limited, private)
|
|
Visibility UserVisibility `json:"visibility"`
|
|
// Whether repository administrators can change team access
|
|
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
|
|
// username of the organization
|
|
// deprecated
|
|
UserName string `json:"username"`
|
|
}
|
|
|
|
// OrganizationPermissions list different users permissions on an organization
|
|
type OrganizationPermissions struct {
|
|
// Whether the user is an owner of the organization
|
|
IsOwner bool `json:"is_owner"`
|
|
// Whether the user is an admin of the organization
|
|
IsAdmin bool `json:"is_admin"`
|
|
// Whether the user can write to the organization
|
|
CanWrite bool `json:"can_write"`
|
|
// Whether the user can read the organization
|
|
CanRead bool `json:"can_read"`
|
|
// Whether the user can create repositories in the organization
|
|
CanCreateRepository bool `json:"can_create_repository"`
|
|
}
|
|
|
|
// CreateOrgOption options for creating an organization
|
|
type CreateOrgOption struct {
|
|
// username of the organization
|
|
// required: true
|
|
UserName string `json:"username" binding:"Required;Username;MaxSize(40)"`
|
|
// The full display name of the organization
|
|
FullName string `json:"full_name" binding:"MaxSize(100)"`
|
|
// The email address of the organization
|
|
Email string `json:"email" binding:"MaxSize(255)"`
|
|
// The description of the organization
|
|
Description string `json:"description" binding:"MaxSize(255)"`
|
|
// The website URL of the organization
|
|
Website string `json:"website" binding:"ValidUrl;MaxSize(255)"`
|
|
// The location of the organization
|
|
Location string `json:"location" binding:"MaxSize(50)"`
|
|
// possible values are `public` (default), `limited` or `private`
|
|
Visibility UserVisibility `json:"visibility" binding:"In(,public,limited,private)"`
|
|
// Whether repository administrators can change team access
|
|
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
|
|
}
|
|
|
|
// EditOrgOption options for editing an organization
|
|
type EditOrgOption struct {
|
|
// The full display name of the organization
|
|
FullName *string `json:"full_name" binding:"MaxSize(100)"`
|
|
// The email address of the organization; use empty string to clear
|
|
Email *string `json:"email" binding:"MaxSize(255)"`
|
|
// The description of the organization
|
|
Description *string `json:"description" binding:"MaxSize(255)"`
|
|
// The website URL of the organization
|
|
Website *string `json:"website" binding:"ValidUrl;MaxSize(255)"`
|
|
// The location of the organization
|
|
Location *string `json:"location" binding:"MaxSize(50)"`
|
|
// possible values are `public`, `limited` or `private`
|
|
Visibility *UserVisibility `json:"visibility" binding:"In(,public,limited,private)"`
|
|
// Whether repository administrators can change team access
|
|
RepoAdminChangeTeamAccess *bool `json:"repo_admin_change_team_access"`
|
|
}
|
|
|
|
// RenameOrgOption options when renaming an organization
|
|
type RenameOrgOption struct {
|
|
// New username for this org. This name cannot be in use yet by any other user.
|
|
//
|
|
// required: true
|
|
// unique: true
|
|
NewName string `json:"new_name" binding:"Required"`
|
|
}
|