autogits/bots-common/gitea-generated/client/organization/organization_client.go
Adam Majer 598ecbbd5a .
2024-07-07 21:12:40 +02:00

2537 lines
93 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package organization
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new organization API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new organization API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new organization API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for organization API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// This client is generated with a few options you might find useful for your swagger spec.
//
// Feel free to add you own set of options.
// WithContentType allows the client to force the Content-Type header
// to negotiate a specific Consumer from the server.
//
// You may use this option to set arbitrary extensions to your MIME media type.
func WithContentType(mime string) ClientOption {
return func(r *runtime.ClientOperation) {
r.ConsumesMediaTypes = []string{mime}
}
}
// WithContentTypeApplicationJSON sets the Content-Type header to "application/json".
func WithContentTypeApplicationJSON(r *runtime.ClientOperation) {
r.ConsumesMediaTypes = []string{"application/json"}
}
// WithContentTypeTextPlain sets the Content-Type header to "text/plain".
func WithContentTypeTextPlain(r *runtime.ClientOperation) {
r.ConsumesMediaTypes = []string{"text/plain"}
}
// WithAccept allows the client to force the Accept header
// to negotiate a specific Producer from the server.
//
// You may use this option to set arbitrary extensions to your MIME media type.
func WithAccept(mime string) ClientOption {
return func(r *runtime.ClientOperation) {
r.ProducesMediaTypes = []string{mime}
}
}
// WithAcceptApplicationJSON sets the Accept header to "application/json".
func WithAcceptApplicationJSON(r *runtime.ClientOperation) {
r.ProducesMediaTypes = []string{"application/json"}
}
// WithAcceptTextHTML sets the Accept header to "text/html".
func WithAcceptTextHTML(r *runtime.ClientOperation) {
r.ProducesMediaTypes = []string{"text/html"}
}
// ClientService is the interface for Client methods
type ClientService interface {
CreateOrgRepo(params *CreateOrgRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoCreated, error)
CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoDeprecatedCreated, error)
CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, *CreateOrgVariableNoContent, error)
DeleteOrgSecret(params *DeleteOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgSecretNoContent, error)
DeleteOrgVariable(params *DeleteOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgVariableOK, *DeleteOrgVariableCreated, *DeleteOrgVariableNoContent, error)
GetOrgVariable(params *GetOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariableOK, error)
GetOrgVariablesList(params *GetOrgVariablesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariablesListOK, error)
OrgAddTeamMember(params *OrgAddTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamMemberNoContent, error)
OrgAddTeamRepository(params *OrgAddTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamRepositoryNoContent, error)
OrgConcealMember(params *OrgConcealMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgConcealMemberNoContent, error)
OrgCreate(params *OrgCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateCreated, error)
OrgCreateHook(params *OrgCreateHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateHookCreated, error)
OrgCreateLabel(params *OrgCreateLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateLabelCreated, error)
OrgCreateTeam(params *OrgCreateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateTeamCreated, error)
OrgDelete(params *OrgDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteNoContent, error)
OrgDeleteAvatar(params *OrgDeleteAvatarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteAvatarNoContent, error)
OrgDeleteHook(params *OrgDeleteHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteHookNoContent, error)
OrgDeleteLabel(params *OrgDeleteLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteLabelNoContent, error)
OrgDeleteMember(params *OrgDeleteMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteMemberNoContent, error)
OrgDeleteTeam(params *OrgDeleteTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteTeamNoContent, error)
OrgEdit(params *OrgEditParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditOK, error)
OrgEditHook(params *OrgEditHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditHookOK, error)
OrgEditLabel(params *OrgEditLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditLabelOK, error)
OrgEditTeam(params *OrgEditTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditTeamOK, error)
OrgGet(params *OrgGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetOK, error)
OrgGetAll(params *OrgGetAllParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetAllOK, error)
OrgGetHook(params *OrgGetHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetHookOK, error)
OrgGetLabel(params *OrgGetLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetLabelOK, error)
OrgGetRunnerRegistrationToken(params *OrgGetRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetRunnerRegistrationTokenOK, error)
OrgGetTeam(params *OrgGetTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetTeamOK, error)
OrgGetUserPermissions(params *OrgGetUserPermissionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetUserPermissionsOK, error)
OrgIsMember(params *OrgIsMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgIsMemberNoContent, error)
OrgIsPublicMember(params *OrgIsPublicMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgIsPublicMemberNoContent, error)
OrgListActionsSecrets(params *OrgListActionsSecretsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListActionsSecretsOK, error)
OrgListActivityFeeds(params *OrgListActivityFeedsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListActivityFeedsOK, error)
OrgListCurrentUserOrgs(params *OrgListCurrentUserOrgsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListCurrentUserOrgsOK, error)
OrgListHooks(params *OrgListHooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListHooksOK, error)
OrgListLabels(params *OrgListLabelsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListLabelsOK, error)
OrgListMembers(params *OrgListMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListMembersOK, error)
OrgListPublicMembers(params *OrgListPublicMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListPublicMembersOK, error)
OrgListRepos(params *OrgListReposParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListReposOK, error)
OrgListTeamActivityFeeds(params *OrgListTeamActivityFeedsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamActivityFeedsOK, error)
OrgListTeamMember(params *OrgListTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamMemberOK, error)
OrgListTeamMembers(params *OrgListTeamMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamMembersOK, error)
OrgListTeamRepo(params *OrgListTeamRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamRepoOK, error)
OrgListTeamRepos(params *OrgListTeamReposParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamReposOK, error)
OrgListTeams(params *OrgListTeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamsOK, error)
OrgListUserOrgs(params *OrgListUserOrgsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListUserOrgsOK, error)
OrgPublicizeMember(params *OrgPublicizeMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgPublicizeMemberNoContent, error)
OrgRemoveTeamMember(params *OrgRemoveTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgRemoveTeamMemberNoContent, error)
OrgRemoveTeamRepository(params *OrgRemoveTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgRemoveTeamRepositoryNoContent, error)
OrgUpdateAvatar(params *OrgUpdateAvatarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgUpdateAvatarNoContent, error)
OrganizationBlockUser(params *OrganizationBlockUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationBlockUserNoContent, error)
OrganizationCheckUserBlock(params *OrganizationCheckUserBlockParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationCheckUserBlockNoContent, error)
OrganizationListBlocks(params *OrganizationListBlocksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationListBlocksOK, error)
OrganizationUnblockUser(params *OrganizationUnblockUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationUnblockUserNoContent, error)
TeamSearch(params *TeamSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TeamSearchOK, error)
UpdateOrgSecret(params *UpdateOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgSecretCreated, *UpdateOrgSecretNoContent, error)
UpdateOrgVariable(params *UpdateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgVariableCreated, *UpdateOrgVariableNoContent, error)
SetTransport(transport runtime.ClientTransport)
}
/*
CreateOrgRepo creates a repository in an organization
*/
func (a *Client) CreateOrgRepo(params *CreateOrgRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateOrgRepoParams()
}
op := &runtime.ClientOperation{
ID: "createOrgRepo",
Method: "POST",
PathPattern: "/orgs/{org}/repos",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateOrgRepoReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CreateOrgRepoCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createOrgRepo: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateOrgRepoDeprecated creates a repository in an organization
*/
func (a *Client) CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoDeprecatedCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateOrgRepoDeprecatedParams()
}
op := &runtime.ClientOperation{
ID: "createOrgRepoDeprecated",
Method: "POST",
PathPattern: "/org/{org}/repos",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateOrgRepoDeprecatedReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CreateOrgRepoDeprecatedCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createOrgRepoDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateOrgVariable creates an org level variable
*/
func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, *CreateOrgVariableNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateOrgVariableParams()
}
op := &runtime.ClientOperation{
ID: "createOrgVariable",
Method: "POST",
PathPattern: "/orgs/{org}/actions/variables/{variablename}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateOrgVariableReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, nil, err
}
switch value := result.(type) {
case *CreateOrgVariableCreated:
return value, nil, nil
case *CreateOrgVariableNoContent:
return nil, value, nil
}
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteOrgSecret deletes a secret in an organization
*/
func (a *Client) DeleteOrgSecret(params *DeleteOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgSecretNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteOrgSecretParams()
}
op := &runtime.ClientOperation{
ID: "deleteOrgSecret",
Method: "DELETE",
PathPattern: "/orgs/{org}/actions/secrets/{secretname}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteOrgSecretReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteOrgSecretNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteOrgSecret: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteOrgVariable deletes an org level variable
*/
func (a *Client) DeleteOrgVariable(params *DeleteOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgVariableOK, *DeleteOrgVariableCreated, *DeleteOrgVariableNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteOrgVariableParams()
}
op := &runtime.ClientOperation{
ID: "deleteOrgVariable",
Method: "DELETE",
PathPattern: "/orgs/{org}/actions/variables/{variablename}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteOrgVariableReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, nil, nil, err
}
switch value := result.(type) {
case *DeleteOrgVariableOK:
return value, nil, nil, nil
case *DeleteOrgVariableCreated:
return nil, value, nil, nil
case *DeleteOrgVariableNoContent:
return nil, nil, value, nil
}
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetOrgVariable gets an org level variable
*/
func (a *Client) GetOrgVariable(params *GetOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariableOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetOrgVariableParams()
}
op := &runtime.ClientOperation{
ID: "getOrgVariable",
Method: "GET",
PathPattern: "/orgs/{org}/actions/variables/{variablename}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetOrgVariableReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetOrgVariableOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getOrgVariable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetOrgVariablesList gets an org level variables list
*/
func (a *Client) GetOrgVariablesList(params *GetOrgVariablesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariablesListOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetOrgVariablesListParams()
}
op := &runtime.ClientOperation{
ID: "getOrgVariablesList",
Method: "GET",
PathPattern: "/orgs/{org}/actions/variables",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetOrgVariablesListReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetOrgVariablesListOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getOrgVariablesList: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgAddTeamMember adds a team member
*/
func (a *Client) OrgAddTeamMember(params *OrgAddTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgAddTeamMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgAddTeamMember",
Method: "PUT",
PathPattern: "/teams/{id}/members/{username}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgAddTeamMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgAddTeamMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgAddTeamMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgAddTeamRepository adds a repository to a team
*/
func (a *Client) OrgAddTeamRepository(params *OrgAddTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamRepositoryNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgAddTeamRepositoryParams()
}
op := &runtime.ClientOperation{
ID: "orgAddTeamRepository",
Method: "PUT",
PathPattern: "/teams/{id}/repos/{org}/{repo}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgAddTeamRepositoryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgAddTeamRepositoryNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgAddTeamRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgConcealMember conceals a user s membership
*/
func (a *Client) OrgConcealMember(params *OrgConcealMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgConcealMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgConcealMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgConcealMember",
Method: "DELETE",
PathPattern: "/orgs/{org}/public_members/{username}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgConcealMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgConcealMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgConcealMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgCreate creates an organization
*/
func (a *Client) OrgCreate(params *OrgCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgCreateParams()
}
op := &runtime.ClientOperation{
ID: "orgCreate",
Method: "POST",
PathPattern: "/orgs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgCreateReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgCreateCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgCreate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgCreateHook creates a hook
*/
func (a *Client) OrgCreateHook(params *OrgCreateHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateHookCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgCreateHookParams()
}
op := &runtime.ClientOperation{
ID: "orgCreateHook",
Method: "POST",
PathPattern: "/orgs/{org}/hooks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgCreateHookReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgCreateHookCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgCreateHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgCreateLabel creates a label for an organization
*/
func (a *Client) OrgCreateLabel(params *OrgCreateLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateLabelCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgCreateLabelParams()
}
op := &runtime.ClientOperation{
ID: "orgCreateLabel",
Method: "POST",
PathPattern: "/orgs/{org}/labels",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgCreateLabelReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgCreateLabelCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgCreateLabel: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgCreateTeam creates a team
*/
func (a *Client) OrgCreateTeam(params *OrgCreateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateTeamCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgCreateTeamParams()
}
op := &runtime.ClientOperation{
ID: "orgCreateTeam",
Method: "POST",
PathPattern: "/orgs/{org}/teams",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgCreateTeamReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgCreateTeamCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgCreateTeam: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgDelete deletes an organization
*/
func (a *Client) OrgDelete(params *OrgDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgDeleteParams()
}
op := &runtime.ClientOperation{
ID: "orgDelete",
Method: "DELETE",
PathPattern: "/orgs/{org}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgDeleteReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgDeleteNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgDelete: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgDeleteAvatar deletes avatar
*/
func (a *Client) OrgDeleteAvatar(params *OrgDeleteAvatarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteAvatarNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgDeleteAvatarParams()
}
op := &runtime.ClientOperation{
ID: "orgDeleteAvatar",
Method: "DELETE",
PathPattern: "/orgs/{org}/avatar",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgDeleteAvatarReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgDeleteAvatarNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgDeleteAvatar: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgDeleteHook deletes a hook
*/
func (a *Client) OrgDeleteHook(params *OrgDeleteHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteHookNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgDeleteHookParams()
}
op := &runtime.ClientOperation{
ID: "orgDeleteHook",
Method: "DELETE",
PathPattern: "/orgs/{org}/hooks/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgDeleteHookReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgDeleteHookNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgDeleteHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgDeleteLabel deletes a label
*/
func (a *Client) OrgDeleteLabel(params *OrgDeleteLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteLabelNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgDeleteLabelParams()
}
op := &runtime.ClientOperation{
ID: "orgDeleteLabel",
Method: "DELETE",
PathPattern: "/orgs/{org}/labels/{id}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgDeleteLabelReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgDeleteLabelNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgDeleteLabel: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgDeleteMember removes a member from an organization
*/
func (a *Client) OrgDeleteMember(params *OrgDeleteMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgDeleteMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgDeleteMember",
Method: "DELETE",
PathPattern: "/orgs/{org}/members/{username}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgDeleteMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgDeleteMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgDeleteMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgDeleteTeam deletes a team
*/
func (a *Client) OrgDeleteTeam(params *OrgDeleteTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteTeamNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgDeleteTeamParams()
}
op := &runtime.ClientOperation{
ID: "orgDeleteTeam",
Method: "DELETE",
PathPattern: "/teams/{id}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgDeleteTeamReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgDeleteTeamNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgDeleteTeam: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgEdit edits an organization
*/
func (a *Client) OrgEdit(params *OrgEditParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgEditParams()
}
op := &runtime.ClientOperation{
ID: "orgEdit",
Method: "PATCH",
PathPattern: "/orgs/{org}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgEditReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgEditOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgEdit: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgEditHook updates a hook
*/
func (a *Client) OrgEditHook(params *OrgEditHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditHookOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgEditHookParams()
}
op := &runtime.ClientOperation{
ID: "orgEditHook",
Method: "PATCH",
PathPattern: "/orgs/{org}/hooks/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgEditHookReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgEditHookOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgEditHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgEditLabel updates a label
*/
func (a *Client) OrgEditLabel(params *OrgEditLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditLabelOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgEditLabelParams()
}
op := &runtime.ClientOperation{
ID: "orgEditLabel",
Method: "PATCH",
PathPattern: "/orgs/{org}/labels/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgEditLabelReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgEditLabelOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgEditLabel: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgEditTeam edits a team
*/
func (a *Client) OrgEditTeam(params *OrgEditTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgEditTeamOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgEditTeamParams()
}
op := &runtime.ClientOperation{
ID: "orgEditTeam",
Method: "PATCH",
PathPattern: "/teams/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgEditTeamReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgEditTeamOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgEditTeam: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGet gets an organization
*/
func (a *Client) OrgGet(params *OrgGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetParams()
}
op := &runtime.ClientOperation{
ID: "orgGet",
Method: "GET",
PathPattern: "/orgs/{org}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGet: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGetAll gets list of organizations
*/
func (a *Client) OrgGetAll(params *OrgGetAllParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetAllOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetAllParams()
}
op := &runtime.ClientOperation{
ID: "orgGetAll",
Method: "GET",
PathPattern: "/orgs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetAllReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetAllOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGetAll: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGetHook gets a hook
*/
func (a *Client) OrgGetHook(params *OrgGetHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetHookOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetHookParams()
}
op := &runtime.ClientOperation{
ID: "orgGetHook",
Method: "GET",
PathPattern: "/orgs/{org}/hooks/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetHookReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetHookOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGetHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGetLabel gets a single label
*/
func (a *Client) OrgGetLabel(params *OrgGetLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetLabelOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetLabelParams()
}
op := &runtime.ClientOperation{
ID: "orgGetLabel",
Method: "GET",
PathPattern: "/orgs/{org}/labels/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetLabelReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetLabelOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGetLabel: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGetRunnerRegistrationToken gets an organization s actions runner registration token
*/
func (a *Client) OrgGetRunnerRegistrationToken(params *OrgGetRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetRunnerRegistrationTokenOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetRunnerRegistrationTokenParams()
}
op := &runtime.ClientOperation{
ID: "orgGetRunnerRegistrationToken",
Method: "GET",
PathPattern: "/orgs/{org}/actions/runners/registration-token",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetRunnerRegistrationTokenReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetRunnerRegistrationTokenOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGetRunnerRegistrationToken: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGetTeam gets a team
*/
func (a *Client) OrgGetTeam(params *OrgGetTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetTeamOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetTeamParams()
}
op := &runtime.ClientOperation{
ID: "orgGetTeam",
Method: "GET",
PathPattern: "/teams/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetTeamReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetTeamOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGetTeam: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgGetUserPermissions gets user permissions in organization
*/
func (a *Client) OrgGetUserPermissions(params *OrgGetUserPermissionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgGetUserPermissionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgGetUserPermissionsParams()
}
op := &runtime.ClientOperation{
ID: "orgGetUserPermissions",
Method: "GET",
PathPattern: "/users/{username}/orgs/{org}/permissions",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgGetUserPermissionsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgGetUserPermissionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgGetUserPermissions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgIsMember checks if a user is a member of an organization
*/
func (a *Client) OrgIsMember(params *OrgIsMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgIsMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgIsMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgIsMember",
Method: "GET",
PathPattern: "/orgs/{org}/members/{username}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgIsMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgIsMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgIsMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgIsPublicMember checks if a user is a public member of an organization
*/
func (a *Client) OrgIsPublicMember(params *OrgIsPublicMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgIsPublicMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgIsPublicMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgIsPublicMember",
Method: "GET",
PathPattern: "/orgs/{org}/public_members/{username}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgIsPublicMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgIsPublicMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgIsPublicMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListActionsSecrets lists an organization s actions secrets
*/
func (a *Client) OrgListActionsSecrets(params *OrgListActionsSecretsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListActionsSecretsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListActionsSecretsParams()
}
op := &runtime.ClientOperation{
ID: "orgListActionsSecrets",
Method: "GET",
PathPattern: "/orgs/{org}/actions/secrets",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListActionsSecretsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListActionsSecretsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListActionsSecrets: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListActivityFeeds lists an organization s activity feeds
*/
func (a *Client) OrgListActivityFeeds(params *OrgListActivityFeedsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListActivityFeedsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListActivityFeedsParams()
}
op := &runtime.ClientOperation{
ID: "orgListActivityFeeds",
Method: "GET",
PathPattern: "/orgs/{org}/activities/feeds",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListActivityFeedsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListActivityFeedsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListActivityFeeds: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListCurrentUserOrgs lists the current user s organizations
*/
func (a *Client) OrgListCurrentUserOrgs(params *OrgListCurrentUserOrgsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListCurrentUserOrgsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListCurrentUserOrgsParams()
}
op := &runtime.ClientOperation{
ID: "orgListCurrentUserOrgs",
Method: "GET",
PathPattern: "/user/orgs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListCurrentUserOrgsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListCurrentUserOrgsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListCurrentUserOrgs: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListHooks lists an organization s webhooks
*/
func (a *Client) OrgListHooks(params *OrgListHooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListHooksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListHooksParams()
}
op := &runtime.ClientOperation{
ID: "orgListHooks",
Method: "GET",
PathPattern: "/orgs/{org}/hooks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListHooksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListHooksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListHooks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListLabels lists an organization s labels
*/
func (a *Client) OrgListLabels(params *OrgListLabelsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListLabelsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListLabelsParams()
}
op := &runtime.ClientOperation{
ID: "orgListLabels",
Method: "GET",
PathPattern: "/orgs/{org}/labels",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListLabelsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListLabelsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListLabels: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListMembers lists an organization s members
*/
func (a *Client) OrgListMembers(params *OrgListMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListMembersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListMembersParams()
}
op := &runtime.ClientOperation{
ID: "orgListMembers",
Method: "GET",
PathPattern: "/orgs/{org}/members",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListMembersReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListMembersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListMembers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListPublicMembers lists an organization s public members
*/
func (a *Client) OrgListPublicMembers(params *OrgListPublicMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListPublicMembersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListPublicMembersParams()
}
op := &runtime.ClientOperation{
ID: "orgListPublicMembers",
Method: "GET",
PathPattern: "/orgs/{org}/public_members",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListPublicMembersReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListPublicMembersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListPublicMembers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListRepos lists an organization s repos
*/
func (a *Client) OrgListRepos(params *OrgListReposParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListReposOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListReposParams()
}
op := &runtime.ClientOperation{
ID: "orgListRepos",
Method: "GET",
PathPattern: "/orgs/{org}/repos",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListReposReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListReposOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListRepos: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListTeamActivityFeeds lists a team s activity feeds
*/
func (a *Client) OrgListTeamActivityFeeds(params *OrgListTeamActivityFeedsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamActivityFeedsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListTeamActivityFeedsParams()
}
op := &runtime.ClientOperation{
ID: "orgListTeamActivityFeeds",
Method: "GET",
PathPattern: "/teams/{id}/activities/feeds",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListTeamActivityFeedsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListTeamActivityFeedsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListTeamActivityFeeds: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListTeamMember lists a particular member of team
*/
func (a *Client) OrgListTeamMember(params *OrgListTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamMemberOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListTeamMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgListTeamMember",
Method: "GET",
PathPattern: "/teams/{id}/members/{username}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListTeamMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListTeamMemberOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListTeamMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListTeamMembers lists a team s members
*/
func (a *Client) OrgListTeamMembers(params *OrgListTeamMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamMembersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListTeamMembersParams()
}
op := &runtime.ClientOperation{
ID: "orgListTeamMembers",
Method: "GET",
PathPattern: "/teams/{id}/members",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListTeamMembersReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListTeamMembersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListTeamMembers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListTeamRepo lists a particular repo of team
*/
func (a *Client) OrgListTeamRepo(params *OrgListTeamRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamRepoOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListTeamRepoParams()
}
op := &runtime.ClientOperation{
ID: "orgListTeamRepo",
Method: "GET",
PathPattern: "/teams/{id}/repos/{org}/{repo}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListTeamRepoReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListTeamRepoOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListTeamRepo: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListTeamRepos lists a team s repos
*/
func (a *Client) OrgListTeamRepos(params *OrgListTeamReposParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamReposOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListTeamReposParams()
}
op := &runtime.ClientOperation{
ID: "orgListTeamRepos",
Method: "GET",
PathPattern: "/teams/{id}/repos",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListTeamReposReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListTeamReposOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListTeamRepos: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListTeams lists an organization s teams
*/
func (a *Client) OrgListTeams(params *OrgListTeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListTeamsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListTeamsParams()
}
op := &runtime.ClientOperation{
ID: "orgListTeams",
Method: "GET",
PathPattern: "/orgs/{org}/teams",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListTeamsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListTeamsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListTeams: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgListUserOrgs lists a user s organizations
*/
func (a *Client) OrgListUserOrgs(params *OrgListUserOrgsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgListUserOrgsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgListUserOrgsParams()
}
op := &runtime.ClientOperation{
ID: "orgListUserOrgs",
Method: "GET",
PathPattern: "/users/{username}/orgs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgListUserOrgsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgListUserOrgsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgListUserOrgs: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgPublicizeMember publicizes a user s membership
*/
func (a *Client) OrgPublicizeMember(params *OrgPublicizeMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgPublicizeMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgPublicizeMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgPublicizeMember",
Method: "PUT",
PathPattern: "/orgs/{org}/public_members/{username}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgPublicizeMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgPublicizeMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgPublicizeMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgRemoveTeamMember removes a team member
*/
func (a *Client) OrgRemoveTeamMember(params *OrgRemoveTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgRemoveTeamMemberNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgRemoveTeamMemberParams()
}
op := &runtime.ClientOperation{
ID: "orgRemoveTeamMember",
Method: "DELETE",
PathPattern: "/teams/{id}/members/{username}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgRemoveTeamMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgRemoveTeamMemberNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgRemoveTeamMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgRemoveTeamRepository removes a repository from a team
This does not delete the repository, it only removes the repository from the team.
*/
func (a *Client) OrgRemoveTeamRepository(params *OrgRemoveTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgRemoveTeamRepositoryNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgRemoveTeamRepositoryParams()
}
op := &runtime.ClientOperation{
ID: "orgRemoveTeamRepository",
Method: "DELETE",
PathPattern: "/teams/{id}/repos/{org}/{repo}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgRemoveTeamRepositoryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgRemoveTeamRepositoryNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgRemoveTeamRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrgUpdateAvatar updates avatar
*/
func (a *Client) OrgUpdateAvatar(params *OrgUpdateAvatarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgUpdateAvatarNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrgUpdateAvatarParams()
}
op := &runtime.ClientOperation{
ID: "orgUpdateAvatar",
Method: "POST",
PathPattern: "/orgs/{org}/avatar",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrgUpdateAvatarReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrgUpdateAvatarNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for orgUpdateAvatar: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrganizationBlockUser blocks a user
*/
func (a *Client) OrganizationBlockUser(params *OrganizationBlockUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationBlockUserNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrganizationBlockUserParams()
}
op := &runtime.ClientOperation{
ID: "organizationBlockUser",
Method: "PUT",
PathPattern: "/orgs/{org}/blocks/{username}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrganizationBlockUserReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrganizationBlockUserNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organizationBlockUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrganizationCheckUserBlock checks if a user is blocked by the organization
*/
func (a *Client) OrganizationCheckUserBlock(params *OrganizationCheckUserBlockParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationCheckUserBlockNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrganizationCheckUserBlockParams()
}
op := &runtime.ClientOperation{
ID: "organizationCheckUserBlock",
Method: "GET",
PathPattern: "/orgs/{org}/blocks/{username}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrganizationCheckUserBlockReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrganizationCheckUserBlockNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organizationCheckUserBlock: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrganizationListBlocks lists users blocked by the organization
*/
func (a *Client) OrganizationListBlocks(params *OrganizationListBlocksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationListBlocksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrganizationListBlocksParams()
}
op := &runtime.ClientOperation{
ID: "organizationListBlocks",
Method: "GET",
PathPattern: "/orgs/{org}/blocks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrganizationListBlocksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrganizationListBlocksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organizationListBlocks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
OrganizationUnblockUser unblocks a user
*/
func (a *Client) OrganizationUnblockUser(params *OrganizationUnblockUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationUnblockUserNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewOrganizationUnblockUserParams()
}
op := &runtime.ClientOperation{
ID: "organizationUnblockUser",
Method: "DELETE",
PathPattern: "/orgs/{org}/blocks/{username}",
ProducesMediaTypes: []string{"application/json", "text/html"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &OrganizationUnblockUserReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*OrganizationUnblockUserNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organizationUnblockUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
TeamSearch searches for teams within an organization
*/
func (a *Client) TeamSearch(params *TeamSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TeamSearchOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewTeamSearchParams()
}
op := &runtime.ClientOperation{
ID: "teamSearch",
Method: "GET",
PathPattern: "/orgs/{org}/teams/search",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "text/plain"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &TeamSearchReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*TeamSearchOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for teamSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateOrgSecret creates or update a secret value in an organization
*/
func (a *Client) UpdateOrgSecret(params *UpdateOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgSecretCreated, *UpdateOrgSecretNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateOrgSecretParams()
}
op := &runtime.ClientOperation{
ID: "updateOrgSecret",
Method: "PUT",
PathPattern: "/orgs/{org}/actions/secrets/{secretname}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateOrgSecretReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, nil, err
}
switch value := result.(type) {
case *UpdateOrgSecretCreated:
return value, nil, nil
case *UpdateOrgSecretNoContent:
return nil, value, nil
}
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateOrgVariable updates an org level variable
*/
func (a *Client) UpdateOrgVariable(params *UpdateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgVariableCreated, *UpdateOrgVariableNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateOrgVariableParams()
}
op := &runtime.ClientOperation{
ID: "updateOrgVariable",
Method: "PUT",
PathPattern: "/orgs/{org}/actions/variables/{variablename}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateOrgVariableReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, nil, err
}
switch value := result.(type) {
case *UpdateOrgVariableCreated:
return value, nil, nil
case *UpdateOrgVariableNoContent:
return nil, value, nil
}
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for organization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}