// Code generated by go-swagger; DO NOT EDIT.

package admin

// 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 admin API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
	return &Client{transport: transport, formats: formats}
}

// New creates a new admin 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 admin 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 admin 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"}
}

// ClientService is the interface for Client methods
type ClientService interface {
	AdminAddUserBadges(params *AdminAddUserBadgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminAddUserBadgesNoContent, error)

	AdminAdoptRepository(params *AdminAdoptRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminAdoptRepositoryNoContent, error)

	AdminCreateHook(params *AdminCreateHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateHookCreated, error)

	AdminCreateOrg(params *AdminCreateOrgParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateOrgCreated, error)

	AdminCreatePublicKey(params *AdminCreatePublicKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreatePublicKeyCreated, error)

	AdminCreateRepo(params *AdminCreateRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateRepoCreated, error)

	AdminCreateUser(params *AdminCreateUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateUserCreated, error)

	AdminCronList(params *AdminCronListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronListOK, error)

	AdminCronRun(params *AdminCronRunParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronRunNoContent, error)

	AdminDeleteHook(params *AdminDeleteHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteHookNoContent, error)

	AdminDeleteUnadoptedRepository(params *AdminDeleteUnadoptedRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUnadoptedRepositoryNoContent, error)

	AdminDeleteUser(params *AdminDeleteUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUserNoContent, error)

	AdminDeleteUserBadges(params *AdminDeleteUserBadgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUserBadgesNoContent, error)

	AdminDeleteUserPublicKey(params *AdminDeleteUserPublicKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUserPublicKeyNoContent, error)

	AdminEditHook(params *AdminEditHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminEditHookOK, error)

	AdminEditUser(params *AdminEditUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminEditUserOK, error)

	AdminGetAllEmails(params *AdminGetAllEmailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetAllEmailsOK, error)

	AdminGetAllOrgs(params *AdminGetAllOrgsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetAllOrgsOK, error)

	AdminGetHook(params *AdminGetHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetHookOK, error)

	AdminGetRunnerRegistrationToken(params *AdminGetRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetRunnerRegistrationTokenOK, error)

	AdminListHooks(params *AdminListHooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminListHooksOK, error)

	AdminListUserBadges(params *AdminListUserBadgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminListUserBadgesOK, error)

	AdminRenameUser(params *AdminRenameUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminRenameUserNoContent, error)

	AdminSearchEmails(params *AdminSearchEmailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminSearchEmailsOK, error)

	AdminSearchUsers(params *AdminSearchUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminSearchUsersOK, error)

	AdminUnadoptedList(params *AdminUnadoptedListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminUnadoptedListOK, error)

	SetTransport(transport runtime.ClientTransport)
}

/*
AdminAddUserBadges adds a badge to a user
*/
func (a *Client) AdminAddUserBadges(params *AdminAddUserBadgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminAddUserBadgesNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminAddUserBadgesParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminAddUserBadges",
		Method:             "POST",
		PathPattern:        "/admin/users/{username}/badges",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminAddUserBadgesReader{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.(*AdminAddUserBadgesNoContent)
	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 adminAddUserBadges: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminAdoptRepository adopts unadopted files as a repository
*/
func (a *Client) AdminAdoptRepository(params *AdminAdoptRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminAdoptRepositoryNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminAdoptRepositoryParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminAdoptRepository",
		Method:             "POST",
		PathPattern:        "/admin/unadopted/{owner}/{repo}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminAdoptRepositoryReader{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.(*AdminAdoptRepositoryNoContent)
	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 adminAdoptRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCreateHook creates a hook
*/
func (a *Client) AdminCreateHook(params *AdminCreateHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateHookCreated, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCreateHookParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCreateHook",
		Method:             "POST",
		PathPattern:        "/admin/hooks",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCreateHookReader{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.(*AdminCreateHookCreated)
	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 adminCreateHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCreateOrg creates an organization
*/
func (a *Client) AdminCreateOrg(params *AdminCreateOrgParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateOrgCreated, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCreateOrgParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCreateOrg",
		Method:             "POST",
		PathPattern:        "/admin/users/{username}/orgs",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCreateOrgReader{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.(*AdminCreateOrgCreated)
	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 adminCreateOrg: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCreatePublicKey adds a public key on behalf of a user
*/
func (a *Client) AdminCreatePublicKey(params *AdminCreatePublicKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreatePublicKeyCreated, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCreatePublicKeyParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCreatePublicKey",
		Method:             "POST",
		PathPattern:        "/admin/users/{username}/keys",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCreatePublicKeyReader{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.(*AdminCreatePublicKeyCreated)
	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 adminCreatePublicKey: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCreateRepo creates a repository on behalf of a user
*/
func (a *Client) AdminCreateRepo(params *AdminCreateRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateRepoCreated, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCreateRepoParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCreateRepo",
		Method:             "POST",
		PathPattern:        "/admin/users/{username}/repos",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCreateRepoReader{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.(*AdminCreateRepoCreated)
	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 adminCreateRepo: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCreateUser creates a user
*/
func (a *Client) AdminCreateUser(params *AdminCreateUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateUserCreated, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCreateUserParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCreateUser",
		Method:             "POST",
		PathPattern:        "/admin/users",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCreateUserReader{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.(*AdminCreateUserCreated)
	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 adminCreateUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCronList lists cron tasks
*/
func (a *Client) AdminCronList(params *AdminCronListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronListOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCronListParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCronList",
		Method:             "GET",
		PathPattern:        "/admin/cron",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCronListReader{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.(*AdminCronListOK)
	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 adminCronList: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminCronRun runs cron task
*/
func (a *Client) AdminCronRun(params *AdminCronRunParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronRunNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminCronRunParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminCronRun",
		Method:             "POST",
		PathPattern:        "/admin/cron/{task}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminCronRunReader{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.(*AdminCronRunNoContent)
	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 adminCronRun: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminDeleteHook deletes a hook
*/
func (a *Client) AdminDeleteHook(params *AdminDeleteHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteHookNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminDeleteHookParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminDeleteHook",
		Method:             "DELETE",
		PathPattern:        "/admin/hooks/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminDeleteHookReader{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.(*AdminDeleteHookNoContent)
	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 adminDeleteHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminDeleteUnadoptedRepository deletes unadopted files
*/
func (a *Client) AdminDeleteUnadoptedRepository(params *AdminDeleteUnadoptedRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUnadoptedRepositoryNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminDeleteUnadoptedRepositoryParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminDeleteUnadoptedRepository",
		Method:             "DELETE",
		PathPattern:        "/admin/unadopted/{owner}/{repo}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminDeleteUnadoptedRepositoryReader{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.(*AdminDeleteUnadoptedRepositoryNoContent)
	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 adminDeleteUnadoptedRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminDeleteUser deletes a user
*/
func (a *Client) AdminDeleteUser(params *AdminDeleteUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUserNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminDeleteUserParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminDeleteUser",
		Method:             "DELETE",
		PathPattern:        "/admin/users/{username}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminDeleteUserReader{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.(*AdminDeleteUserNoContent)
	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 adminDeleteUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminDeleteUserBadges removes a badge from a user
*/
func (a *Client) AdminDeleteUserBadges(params *AdminDeleteUserBadgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUserBadgesNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminDeleteUserBadgesParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminDeleteUserBadges",
		Method:             "DELETE",
		PathPattern:        "/admin/users/{username}/badges",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminDeleteUserBadgesReader{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.(*AdminDeleteUserBadgesNoContent)
	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 adminDeleteUserBadges: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminDeleteUserPublicKey deletes a user s public key
*/
func (a *Client) AdminDeleteUserPublicKey(params *AdminDeleteUserPublicKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminDeleteUserPublicKeyNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminDeleteUserPublicKeyParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminDeleteUserPublicKey",
		Method:             "DELETE",
		PathPattern:        "/admin/users/{username}/keys/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminDeleteUserPublicKeyReader{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.(*AdminDeleteUserPublicKeyNoContent)
	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 adminDeleteUserPublicKey: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminEditHook updates a hook
*/
func (a *Client) AdminEditHook(params *AdminEditHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminEditHookOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminEditHookParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminEditHook",
		Method:             "PATCH",
		PathPattern:        "/admin/hooks/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminEditHookReader{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.(*AdminEditHookOK)
	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 adminEditHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminEditUser edits an existing user
*/
func (a *Client) AdminEditUser(params *AdminEditUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminEditUserOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminEditUserParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminEditUser",
		Method:             "PATCH",
		PathPattern:        "/admin/users/{username}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminEditUserReader{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.(*AdminEditUserOK)
	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 adminEditUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminGetAllEmails lists all emails
*/
func (a *Client) AdminGetAllEmails(params *AdminGetAllEmailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetAllEmailsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminGetAllEmailsParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminGetAllEmails",
		Method:             "GET",
		PathPattern:        "/admin/emails",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminGetAllEmailsReader{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.(*AdminGetAllEmailsOK)
	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 adminGetAllEmails: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminGetAllOrgs lists all organizations
*/
func (a *Client) AdminGetAllOrgs(params *AdminGetAllOrgsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetAllOrgsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminGetAllOrgsParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminGetAllOrgs",
		Method:             "GET",
		PathPattern:        "/admin/orgs",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminGetAllOrgsReader{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.(*AdminGetAllOrgsOK)
	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 adminGetAllOrgs: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminGetHook gets a hook
*/
func (a *Client) AdminGetHook(params *AdminGetHookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetHookOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminGetHookParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminGetHook",
		Method:             "GET",
		PathPattern:        "/admin/hooks/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminGetHookReader{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.(*AdminGetHookOK)
	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 adminGetHook: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminGetRunnerRegistrationToken gets an global actions runner registration token
*/
func (a *Client) AdminGetRunnerRegistrationToken(params *AdminGetRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminGetRunnerRegistrationTokenOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminGetRunnerRegistrationTokenParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminGetRunnerRegistrationToken",
		Method:             "GET",
		PathPattern:        "/admin/runners/registration-token",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminGetRunnerRegistrationTokenReader{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.(*AdminGetRunnerRegistrationTokenOK)
	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 adminGetRunnerRegistrationToken: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminListHooks lists system s webhooks
*/
func (a *Client) AdminListHooks(params *AdminListHooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminListHooksOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminListHooksParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminListHooks",
		Method:             "GET",
		PathPattern:        "/admin/hooks",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminListHooksReader{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.(*AdminListHooksOK)
	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 adminListHooks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminListUserBadges lists a user s badges
*/
func (a *Client) AdminListUserBadges(params *AdminListUserBadgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminListUserBadgesOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminListUserBadgesParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminListUserBadges",
		Method:             "GET",
		PathPattern:        "/admin/users/{username}/badges",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminListUserBadgesReader{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.(*AdminListUserBadgesOK)
	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 adminListUserBadges: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminRenameUser renames a user
*/
func (a *Client) AdminRenameUser(params *AdminRenameUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminRenameUserNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminRenameUserParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminRenameUser",
		Method:             "POST",
		PathPattern:        "/admin/users/{username}/rename",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminRenameUserReader{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.(*AdminRenameUserNoContent)
	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 adminRenameUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminSearchEmails searches all emails
*/
func (a *Client) AdminSearchEmails(params *AdminSearchEmailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminSearchEmailsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminSearchEmailsParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminSearchEmails",
		Method:             "GET",
		PathPattern:        "/admin/emails/search",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminSearchEmailsReader{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.(*AdminSearchEmailsOK)
	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 adminSearchEmails: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminSearchUsers searches users according filter conditions
*/
func (a *Client) AdminSearchUsers(params *AdminSearchUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminSearchUsersOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminSearchUsersParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminSearchUsers",
		Method:             "GET",
		PathPattern:        "/admin/users",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminSearchUsersReader{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.(*AdminSearchUsersOK)
	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 adminSearchUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
AdminUnadoptedList lists unadopted repositories
*/
func (a *Client) AdminUnadoptedList(params *AdminUnadoptedListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminUnadoptedListOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAdminUnadoptedListParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "adminUnadoptedList",
		Method:             "GET",
		PathPattern:        "/admin/unadopted",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "text/plain"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AdminUnadoptedListReader{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.(*AdminUnadoptedListOK)
	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 adminUnadoptedList: 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
}
