/* Generated by restful-react */ import React from 'react' import { Get, GetProps, useGet, UseGetProps, Mutate, MutateProps, useMutate, UseMutateProps } from 'restful-react' import { getConfig } from '../config' export const SPEC_VERSION = '0.0.0' export type EnumAccessGrant = number export type EnumCheckPayloadKind = '' | 'markdown' | 'raw' export type EnumCheckStatus = 'error' | 'failure' | 'pending' | 'running' | 'success' export type EnumContentEncodingType = 'base64' | 'utf8' export type EnumMembershipRole = 'contributor' | 'executor' | 'reader' | 'space_owner' export type EnumMergeCheckStatus = string export type EnumMergeMethod = 'merge' | 'squash' | 'rebase' export type EnumParentResourceType = 'space' | 'repo' export type EnumPathTargetType = string export type EnumPrincipalType = 'service' | 'serviceaccount' | 'user' export type EnumPullReqActivityKind = 'change-comment' | 'comment' | 'system' export type EnumPullReqActivityType = | 'branch-delete' | 'branch-update' | 'code-comment' | 'comment' | 'merge' | 'review-submit' | 'state-change' | 'title-change' export type EnumPullReqCommentStatus = 'active' | 'resolved' export type EnumPullReqReviewDecision = 'approved' | 'changereq' | 'pending' | 'reviewed' export type EnumPullReqReviewerType = 'assigned' | 'requested' | 'self_assigned' export type EnumPullReqState = 'closed' | 'merged' | 'open' export type EnumTokenType = string export type EnumWebhookExecutionResult = 'fatal_error' | 'retriable_error' | 'success' | null export type EnumWebhookParent = 'repo' | 'space' export type EnumWebhookTrigger = | 'branch_created' | 'branch_deleted' | 'branch_updated' | 'pullreq_branch_updated' | 'pullreq_created' | 'pullreq_reopened' | 'tag_created' | 'tag_deleted' | 'tag_updated' export interface GitrpcBlamePart { commit?: GitrpcCommit lines?: string[] | null } export interface GitrpcCommit { author?: GitrpcSignature committer?: GitrpcSignature message?: string sha?: string title?: string } export type GitrpcFileAction = 'CREATE' | 'UPDATE' | 'DELETE' | 'MOVE' export interface GitrpcFileDiff { additions?: number changes?: number content_url?: string deletions?: number is_binary?: boolean is_submodule?: boolean old_path?: string old_sha?: string patch?: number[] path?: string sha?: string status?: string } export interface GitrpcIdentity { email?: string name?: string } export interface GitrpcPathDetails { last_commit?: GitrpcCommit path?: string size?: number } export interface GitrpcSignature { identity?: GitrpcIdentity when?: string } export interface OpenapiAdminUsersCreateRequest { display_name?: string email?: string password?: string uid?: string } export interface OpenapiAdminUsersUpdateRequest { display_name?: string | null email?: string | null password?: string | null } export interface OpenapiCalculateCommitDivergenceRequest { max_count?: number requests?: RepoCommitDivergenceRequest[] | null } export interface OpenapiCommentCreatePullReqRequest { line_end?: number line_end_new?: boolean line_start?: number line_start_new?: boolean parent_id?: number path?: string source_commit_sha?: string target_commit_sha?: string text?: string } export interface OpenapiCommentStatusPullReqRequest { status?: EnumPullReqCommentStatus } export interface OpenapiCommentUpdatePullReqRequest { text?: string } export interface OpenapiCommitFilesRequest { actions?: RepoCommitFileAction[] | null branch?: string message?: string new_branch?: string title?: string } export type OpenapiContent = RepoFileContent | OpenapiDirContent | RepoSymlinkContent | RepoSubmoduleContent export interface OpenapiContentInfo { latest_commit?: TypesCommit name?: string path?: string sha?: string type?: OpenapiContentType } export type OpenapiContentType = 'file' | 'dir' | 'symlink' | 'submodule' export interface OpenapiCreateBranchRequest { name?: string target?: string } export interface OpenapiCreateConnectorRequest { data?: string description?: string space_ref?: string type?: string uid?: string } export interface OpenapiCreateExecutionRequest { status?: string } export interface OpenapiCreatePathRequest { path?: string } export interface OpenapiCreatePipelineRequest { config_path?: string default_branch?: string description?: string uid?: string } export interface OpenapiCreatePullReqRequest { description?: string is_draft?: boolean source_branch?: string source_repo_ref?: string target_branch?: string title?: string } export interface OpenapiCreateRepoPathRequest { path?: string } export interface OpenapiCreateRepositoryRequest { default_branch?: string description?: string fork_id?: number git_ignore?: string is_public?: boolean license?: string parent_ref?: string readme?: boolean uid?: string } export interface OpenapiCreateSecretRequest { data?: string description?: string space_ref?: string uid?: string } export interface OpenapiCreateSpaceRequest { description?: string is_public?: boolean parent_ref?: string uid?: string } export interface OpenapiCreateTagRequest { message?: string name?: string target?: string } export interface OpenapiCreateTemplateRequest { data?: string description?: string space_ref?: string type?: string uid?: string } export interface OpenapiCreateTokenRequest { grants?: EnumAccessGrant lifetime?: TimeDuration uid?: string } export interface OpenapiCreateTriggerRequest { description?: string uid?: string } export interface OpenapiCreateWebhookRequest { description?: string display_name?: string enabled?: boolean insecure?: boolean secret?: string triggers?: EnumWebhookTrigger[] | null url?: string } export interface OpenapiDirContent { entries?: OpenapiContentInfo[] | null } export interface OpenapiGetContentOutput { content?: OpenapiContent latest_commit?: TypesCommit name?: string path?: string sha?: string type?: OpenapiContentType } export interface OpenapiLoginRequest { login_identifier?: string password?: string } export interface OpenapiMergePullReq { method?: EnumMergeMethod source_sha?: string } export interface OpenapiMoveRepoRequest { keep_as_alias?: boolean parent_ref?: string | null uid?: string | null } export interface OpenapiMoveSpaceRequest { keep_as_alias?: boolean parent_ref?: string | null uid?: string | null } export interface OpenapiPathsDetailsRequest { paths?: string[] | null } export interface OpenapiRegisterRequest { display_name?: string email?: string password?: string uid?: string } export interface OpenapiReviewSubmitPullReqRequest { commit_sha?: string decision?: EnumPullReqReviewDecision message?: string } export interface OpenapiReviewerAddPullReqRequest { reviewer_id?: number } export interface OpenapiStatePullReqRequest { is_draft?: boolean message?: string state?: EnumPullReqState } export interface OpenapiUpdateAdminRequest { admin?: boolean } export interface OpenapiUpdateConnectorRequest { data?: string description?: string uid?: string } export interface OpenapiUpdateExecutionRequest { status?: string } export interface OpenapiUpdatePipelineRequest { config_path?: string description?: string uid?: string } export interface OpenapiUpdatePullReqRequest { description?: string title?: string } export interface OpenapiUpdateRepoRequest { description?: string | null is_public?: boolean | null } export interface OpenapiUpdateSecretRequest { data?: string description?: string uid?: string } export interface OpenapiUpdateSpaceRequest { description?: string | null is_public?: boolean | null } export interface OpenapiUpdateTemplateRequest { data?: string description?: string uid?: string } export interface OpenapiUpdateTriggerRequest { description?: string uid?: string } export interface OpenapiUpdateWebhookRequest { description?: string | null display_name?: string | null enabled?: boolean | null insecure?: boolean | null secret?: string | null triggers?: EnumWebhookTrigger[] | null url?: string | null } export interface OpenapiWebhookType { created?: number created_by?: number description?: string display_name?: string enabled?: boolean has_secret?: boolean id?: number insecure?: boolean latest_execution_result?: EnumWebhookExecutionResult parent_id?: number parent_type?: EnumWebhookParent triggers?: EnumWebhookTrigger[] | null updated?: number url?: string version?: number } export interface RepoBranch { commit?: TypesCommit name?: string sha?: string } export interface RepoCommitDivergence { ahead?: number behind?: number } export interface RepoCommitDivergenceRequest { from?: string to?: string } export interface RepoCommitFileAction { action?: GitrpcFileAction encoding?: EnumContentEncodingType path?: string payload?: string sha?: string } export interface RepoCommitFilesResponse { commit_id?: string } export interface RepoCommitTag { commit?: TypesCommit is_annotated?: boolean message?: string name?: string sha?: string tagger?: TypesSignature title?: string } // tslint:disable-next-line:no-empty-interface export interface RepoContent {} export interface RepoContentInfo { latest_commit?: TypesCommit name?: string path?: string sha?: string type?: RepoContentType } export type RepoContentType = string export interface RepoFileContent { data?: string data_size?: number encoding?: EnumContentEncodingType size?: number } export interface RepoMergeCheck { conflict_files?: string[] mergeable?: boolean } export interface RepoPathsDetailsOutput { details?: GitrpcPathDetails[] | null } export interface RepoSubmoduleContent { commit_sha?: string url?: string } export interface RepoSymlinkContent { size?: number target?: string } export interface SystemConfigOutput { sign_up_allowed?: boolean } export type TimeDuration = number | null export interface TypesCheck { created?: number id?: number link?: string metadata?: {} payload?: TypesCheckPayload reported_by?: TypesPrincipalInfo status?: EnumCheckStatus summary?: string uid?: string updated?: number } export interface TypesCheckPayload { data?: {} kind?: EnumCheckPayloadKind version?: string } export interface TypesCodeCommentFields { line_new?: number line_old?: number merge_base_sha?: string outdated?: boolean path?: string source_sha?: string span_new?: number span_old?: number } export interface TypesCommit { author?: TypesSignature committer?: TypesSignature message?: string sha?: string title?: string } export interface TypesConnector { created?: number data?: string description?: string id?: number space_id?: number type?: string uid?: string updated?: number } export interface TypesDiffStats { commits?: number files_changed?: number } export interface TypesExecution { action?: string after?: string author_avatar?: string author_email?: string author_login?: string author_name?: string before?: string created?: number cron?: string debug?: boolean deploy_id?: number deploy_to?: string error?: string event?: string finished?: number link?: string message?: string number?: number params?: { [key: string]: string } parent?: number pipeline_id?: number ref?: string repo_id?: number sender?: string source?: string source_repo?: string stages?: TypesStage[] started?: number status?: string target?: string timestamp?: number title?: string trigger?: string updated?: number } export interface TypesIdentity { email?: string name?: string } export interface TypesListCommitResponse { commits?: TypesCommit[] | null rename_details?: TypesRenameDetails[] | null total_commits?: number } export interface TypesMembershipSpace { added_by?: TypesPrincipalInfo created?: number role?: EnumMembershipRole space?: TypesSpace updated?: number } export interface TypesMembershipUser { added_by?: TypesPrincipalInfo created?: number principal?: TypesPrincipalInfo role?: EnumMembershipRole updated?: number } export interface TypesMergeResponse { conflict_files?: string[] sha?: string } export interface TypesPath { created?: number created_by?: number id?: number is_primary?: boolean target_id?: number target_type?: EnumPathTargetType updated?: number value?: string } export interface TypesPipeline { config_path?: string created?: number default_branch?: string description?: string execution?: TypesExecution id?: number repo_id?: number seq?: number uid?: string updated?: number } export interface TypesPlugin { description?: string logo?: string spec?: string uid?: string } export interface TypesPrincipalInfo { created?: number display_name?: string email?: string id?: number type?: EnumPrincipalType uid?: string updated?: number } export interface TypesPullReq { author?: TypesPrincipalInfo created?: number description?: string edited?: number is_draft?: boolean merge_base_sha?: string merge_check_status?: EnumMergeCheckStatus merge_conflicts?: string | null merge_method?: EnumMergeMethod merge_sha?: string | null merge_target_sha?: string | null merged?: number | null merger?: TypesPrincipalInfo number?: number source_branch?: string source_repo_id?: number source_sha?: string state?: EnumPullReqState stats?: TypesPullReqStats target_branch?: string target_repo_id?: number title?: string } export interface TypesPullReqActivity { author?: TypesPrincipalInfo code_comment?: TypesCodeCommentFields created?: number deleted?: number | null edited?: number id?: number kind?: EnumPullReqActivityKind metadata?: { [key: string]: any } | null order?: number parent_id?: number | null payload?: {} pullreq_id?: number repo_id?: number resolved?: number | null resolver?: TypesPrincipalInfo sub_order?: number text?: string type?: EnumPullReqActivityType } export interface TypesPullReqReviewer { added_by?: TypesPrincipalInfo created?: number latest_review_id?: number | null review_decision?: EnumPullReqReviewDecision reviewer?: TypesPrincipalInfo sha?: string type?: EnumPullReqReviewerType updated?: number } export interface TypesPullReqStats { commits?: number conversations?: number files_changed?: number unresolved_count?: number } export interface TypesRenameDetails { commit_sha_after?: string commit_sha_before?: string new_path?: string old_path?: string } export interface TypesRepository { created?: number created_by?: number default_branch?: string description?: string fork_id?: number git_url?: string id?: number is_public?: boolean num_closed_pulls?: number num_forks?: number num_merged_pulls?: number num_open_pulls?: number num_pulls?: number parent_id?: number path?: string uid?: string updated?: number } export interface TypesSecret { created?: number description?: string id?: number space_id?: number uid?: string updated?: number } export interface TypesServiceAccount { admin?: boolean blocked?: boolean created?: number display_name?: string email?: string parent_id?: number parent_type?: EnumParentResourceType uid?: string updated?: number } export interface TypesSignature { identity?: TypesIdentity when?: string } export interface TypesSpace { created?: number created_by?: number description?: string id?: number is_public?: boolean parent_id?: number path?: string uid?: string updated?: number } export interface TypesStage { arch?: string depends_on?: string[] | null errignore?: boolean error?: string execution_id?: number exit_code?: number kernel?: string kind?: string labels?: { [key: string]: string } limit?: number machine?: string name?: string number?: number on_failure?: boolean on_success?: boolean os?: string started?: number status?: string steps?: TypesStep[] stopped?: number throttle?: number type?: string variant?: string } export interface TypesStep { depends_on?: string[] | null detached?: boolean errignore?: boolean error?: string exit_code?: number image?: string name?: string number?: number schema?: string started?: number status?: string stopped?: number } export interface TypesTemplate { created?: number data?: string description?: string id?: number space_id?: number uid?: string updated?: number } export interface TypesToken { created_by?: number expires_at?: number | null grants?: EnumAccessGrant issued_at?: number principal_id?: number type?: EnumTokenType uid?: string } export interface TypesTokenResponse { access_token?: string token?: TypesToken } export interface TypesTrigger { created?: number description?: string id?: number pipeline_id?: number uid?: string updated?: number } export interface TypesUser { admin?: boolean blocked?: boolean created?: number display_name?: string email?: string uid?: string updated?: number } export interface TypesWebhookExecution { created?: number duration?: number error?: string id?: number request?: TypesWebhookExecutionRequest response?: TypesWebhookExecutionResponse result?: EnumWebhookExecutionResult retrigger_of?: number | null retriggerable?: boolean trigger_type?: EnumWebhookTrigger webhook_id?: number } export interface TypesWebhookExecutionRequest { body?: string headers?: string url?: string } export interface TypesWebhookExecutionResponse { body?: string headers?: string status?: string status_code?: number } export interface UserUpdateInput { display_name?: string | null email?: string | null password?: string | null } export interface UsererrorError { message?: string values?: { [key: string]: any } } export interface AdminListUsersQueryParams { sort?: 'id' | 'email' | 'created' | 'updated' order?: 'asc' | 'desc' page?: number limit?: number } export type AdminListUsersProps = Omit, 'path'> export const AdminListUsers = (props: AdminListUsersProps) => ( path={`/admin/users`} base={getConfig('code/api/v1')} {...props} /> ) export type UseAdminListUsersProps = Omit< UseGetProps, 'path' > export const useAdminListUsers = (props: UseAdminListUsersProps) => useGet(`/admin/users`, { base: getConfig('code/api/v1'), ...props }) export type AdminCreateUserProps = Omit< MutateProps, 'path' | 'verb' > export const AdminCreateUser = (props: AdminCreateUserProps) => ( verb="POST" path={`/admin/users`} base={getConfig('code/api/v1')} {...props} /> ) export type UseAdminCreateUserProps = Omit< UseMutateProps, 'path' | 'verb' > export const useAdminCreateUser = (props: UseAdminCreateUserProps) => useMutate('POST', `/admin/users`, { base: getConfig('code/api/v1'), ...props }) export type AdminDeleteUserProps = Omit, 'path' | 'verb'> export const AdminDeleteUser = (props: AdminDeleteUserProps) => ( verb="DELETE" path={`/admin/users`} base={getConfig('code/api/v1')} {...props} /> ) export type UseAdminDeleteUserProps = Omit, 'path' | 'verb'> export const useAdminDeleteUser = (props: UseAdminDeleteUserProps) => useMutate('DELETE', `/admin/users`, { base: getConfig('code/api/v1'), ...props }) export interface AdminGetUserPathParams { user_uid: string } export type AdminGetUserProps = Omit, 'path'> & AdminGetUserPathParams export const AdminGetUser = ({ user_uid, ...props }: AdminGetUserProps) => ( path={`/admin/users/${user_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseAdminGetUserProps = Omit, 'path'> & AdminGetUserPathParams export const useAdminGetUser = ({ user_uid, ...props }: UseAdminGetUserProps) => useGet( (paramsInPath: AdminGetUserPathParams) => `/admin/users/${paramsInPath.user_uid}`, { base: getConfig('code/api/v1'), pathParams: { user_uid }, ...props } ) export interface AdminUpdateUserPathParams { user_uid: string } export type AdminUpdateUserProps = Omit< MutateProps, 'path' | 'verb' > & AdminUpdateUserPathParams export const AdminUpdateUser = ({ user_uid, ...props }: AdminUpdateUserProps) => ( verb="PATCH" path={`/admin/users/${user_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseAdminUpdateUserProps = Omit< UseMutateProps, 'path' | 'verb' > & AdminUpdateUserPathParams export const useAdminUpdateUser = ({ user_uid, ...props }: UseAdminUpdateUserProps) => useMutate( 'PATCH', (paramsInPath: AdminUpdateUserPathParams) => `/admin/users/${paramsInPath.user_uid}`, { base: getConfig('code/api/v1'), pathParams: { user_uid }, ...props } ) export interface UpdateUserAdminPathParams { user_uid: string } export type UpdateUserAdminProps = Omit< MutateProps, 'path' | 'verb' > & UpdateUserAdminPathParams export const UpdateUserAdmin = ({ user_uid, ...props }: UpdateUserAdminProps) => ( verb="PATCH" path={`/admin/users/${user_uid}/admin`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateUserAdminProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateUserAdminPathParams export const useUpdateUserAdmin = ({ user_uid, ...props }: UseUpdateUserAdminProps) => useMutate( 'PATCH', (paramsInPath: UpdateUserAdminPathParams) => `/admin/users/${paramsInPath.user_uid}/admin`, { base: getConfig('code/api/v1'), pathParams: { user_uid }, ...props } ) export type CreateConnectorProps = Omit< MutateProps, 'path' | 'verb' > export const CreateConnector = (props: CreateConnectorProps) => ( verb="POST" path={`/connectors`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateConnectorProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateConnector = (props: UseCreateConnectorProps) => useMutate('POST', `/connectors`, { base: getConfig('code/api/v1'), ...props }) export type DeleteConnectorProps = Omit, 'path' | 'verb'> export const DeleteConnector = (props: DeleteConnectorProps) => ( verb="DELETE" path={`/connectors`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteConnectorProps = Omit, 'path' | 'verb'> export const useDeleteConnector = (props: UseDeleteConnectorProps) => useMutate('DELETE', `/connectors`, { base: getConfig('code/api/v1'), ...props }) export interface FindConnectorPathParams { connector_ref: string } export type FindConnectorProps = Omit, 'path'> & FindConnectorPathParams export const FindConnector = ({ connector_ref, ...props }: FindConnectorProps) => ( path={`/connectors/${connector_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindConnectorProps = Omit< UseGetProps, 'path' > & FindConnectorPathParams export const useFindConnector = ({ connector_ref, ...props }: UseFindConnectorProps) => useGet( (paramsInPath: FindConnectorPathParams) => `/connectors/${paramsInPath.connector_ref}`, { base: getConfig('code/api/v1'), pathParams: { connector_ref }, ...props } ) export interface UpdateConnectorPathParams { connector_ref: string } export type UpdateConnectorProps = Omit< MutateProps, 'path' | 'verb' > & UpdateConnectorPathParams export const UpdateConnector = ({ connector_ref, ...props }: UpdateConnectorProps) => ( verb="PATCH" path={`/connectors/${connector_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateConnectorProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateConnectorPathParams export const useUpdateConnector = ({ connector_ref, ...props }: UseUpdateConnectorProps) => useMutate( 'PATCH', (paramsInPath: UpdateConnectorPathParams) => `/connectors/${paramsInPath.connector_ref}`, { base: getConfig('code/api/v1'), pathParams: { connector_ref }, ...props } ) export type OnLoginProps = Omit< MutateProps, 'path' | 'verb' > export const OnLogin = (props: OnLoginProps) => ( verb="POST" path={`/login`} base={getConfig('code/api/v1')} {...props} /> ) export type UseOnLoginProps = Omit< UseMutateProps, 'path' | 'verb' > export const useOnLogin = (props: UseOnLoginProps) => useMutate('POST', `/login`, { base: getConfig('code/api/v1'), ...props }) export type OpLogoutProps = Omit, 'path' | 'verb'> export const OpLogout = (props: OpLogoutProps) => ( verb="POST" path={`/logout`} base={getConfig('code/api/v1')} {...props} /> ) export type UseOpLogoutProps = Omit, 'path' | 'verb'> export const useOpLogout = (props: UseOpLogoutProps) => useMutate('POST', `/logout`, { base: getConfig('code/api/v1'), ...props }) export interface ListPluginsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number /** * The substring which is used to filter the plugins by their name. */ query?: string } export type ListPluginsProps = Omit, 'path'> export const ListPlugins = (props: ListPluginsProps) => ( path={`/plugins`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPluginsProps = Omit, 'path'> export const useListPlugins = (props: UseListPluginsProps) => useGet(`/plugins`, { base: getConfig('code/api/v1'), ...props }) export interface ListPrincipalsQueryParams { /** * The substring by which the principals are filtered. */ query?: string /** * The account ID the principals are retrieved for (Not required in standalone). */ accountIdentifier?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number /** * The types of principals to include. */ type?: ('service' | 'serviceaccount' | 'user')[] } export type ListPrincipalsProps = Omit< GetProps, 'path' > export const ListPrincipals = (props: ListPrincipalsProps) => ( path={`/principals`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPrincipalsProps = Omit< UseGetProps, 'path' > export const useListPrincipals = (props: UseListPrincipalsProps) => useGet(`/principals`, { base: getConfig('code/api/v1'), ...props }) export type OnRegisterProps = Omit< MutateProps, 'path' | 'verb' > export const OnRegister = (props: OnRegisterProps) => ( verb="POST" path={`/register`} base={getConfig('code/api/v1')} {...props} /> ) export type UseOnRegisterProps = Omit< UseMutateProps, 'path' | 'verb' > export const useOnRegister = (props: UseOnRegisterProps) => useMutate('POST', `/register`, { base: getConfig('code/api/v1'), ...props }) export interface CreateRepositoryQueryParams { /** * path of parent space (Not needed in standalone). */ space_path?: string } export type CreateRepositoryProps = Omit< MutateProps, 'path' | 'verb' > export const CreateRepository = (props: CreateRepositoryProps) => ( verb="POST" path={`/repos`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateRepositoryProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateRepository = (props: UseCreateRepositoryProps) => useMutate( 'POST', `/repos`, { base: getConfig('code/api/v1'), ...props } ) export type DeleteRepositoryProps = Omit, 'path' | 'verb'> export const DeleteRepository = (props: DeleteRepositoryProps) => ( verb="DELETE" path={`/repos`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteRepositoryProps = Omit, 'path' | 'verb'> export const useDeleteRepository = (props: UseDeleteRepositoryProps) => useMutate('DELETE', `/repos`, { base: getConfig('code/api/v1'), ...props }) export interface FindRepositoryPathParams { repo_ref: string } export type FindRepositoryProps = Omit< GetProps, 'path' > & FindRepositoryPathParams export const FindRepository = ({ repo_ref, ...props }: FindRepositoryProps) => ( path={`/repos/${repo_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindRepositoryProps = Omit< UseGetProps, 'path' > & FindRepositoryPathParams export const useFindRepository = ({ repo_ref, ...props }: UseFindRepositoryProps) => useGet( (paramsInPath: FindRepositoryPathParams) => `/repos/${paramsInPath.repo_ref}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface UpdateRepositoryPathParams { repo_ref: string } export type UpdateRepositoryProps = Omit< MutateProps, 'path' | 'verb' > & UpdateRepositoryPathParams export const UpdateRepository = ({ repo_ref, ...props }: UpdateRepositoryProps) => ( verb="PATCH" path={`/repos/${repo_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateRepositoryProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateRepositoryPathParams export const useUpdateRepository = ({ repo_ref, ...props }: UseUpdateRepositoryProps) => useMutate( 'PATCH', (paramsInPath: UpdateRepositoryPathParams) => `/repos/${paramsInPath.repo_ref}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface GetBlameQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string /** * Line number from which the file data is considered */ line_from?: number /** * Line number to which the file data is considered */ line_to?: number } export interface GetBlamePathParams { repo_ref: string path: string } export type GetBlameProps = Omit< GetProps, 'path' > & GetBlamePathParams export const GetBlame = ({ repo_ref, path, ...props }: GetBlameProps) => ( path={`/repos/${repo_ref}/blame/${path}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetBlameProps = Omit< UseGetProps, 'path' > & GetBlamePathParams export const useGetBlame = ({ repo_ref, path, ...props }: UseGetBlameProps) => useGet( (paramsInPath: GetBlamePathParams) => `/repos/${paramsInPath.repo_ref}/blame/${paramsInPath.path}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, path }, ...props } ) export interface ListBranchesQueryParams { /** * Indicates whether optional commit information should be included in the response. */ include_commit?: boolean /** * The substring by which the branches are filtered. */ query?: string /** * The order of the output. */ order?: 'asc' | 'desc' /** * The data by which the branches are sorted. */ sort?: 'name' | 'date' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListBranchesPathParams { repo_ref: string } export type ListBranchesProps = Omit< GetProps, 'path' > & ListBranchesPathParams export const ListBranches = ({ repo_ref, ...props }: ListBranchesProps) => ( path={`/repos/${repo_ref}/branches`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListBranchesProps = Omit< UseGetProps, 'path' > & ListBranchesPathParams export const useListBranches = ({ repo_ref, ...props }: UseListBranchesProps) => useGet( (paramsInPath: ListBranchesPathParams) => `/repos/${paramsInPath.repo_ref}/branches`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CreateBranchPathParams { repo_ref: string } export type CreateBranchProps = Omit< MutateProps, 'path' | 'verb' > & CreateBranchPathParams export const CreateBranch = ({ repo_ref, ...props }: CreateBranchProps) => ( verb="POST" path={`/repos/${repo_ref}/branches`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateBranchProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateBranchPathParams export const useCreateBranch = ({ repo_ref, ...props }: UseCreateBranchProps) => useMutate( 'POST', (paramsInPath: CreateBranchPathParams) => `/repos/${paramsInPath.repo_ref}/branches`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface DeleteBranchPathParams { repo_ref: string } export type DeleteBranchProps = Omit< MutateProps, 'path' | 'verb' > & DeleteBranchPathParams export const DeleteBranch = ({ repo_ref, ...props }: DeleteBranchProps) => ( verb="DELETE" path={`/repos/${repo_ref}/branches`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteBranchProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteBranchPathParams export const useDeleteBranch = ({ repo_ref, ...props }: UseDeleteBranchProps) => useMutate( 'DELETE', (paramsInPath: DeleteBranchPathParams) => `/repos/${paramsInPath.repo_ref}/branches`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface GetBranchPathParams { repo_ref: string branch_name: string } export type GetBranchProps = Omit, 'path'> & GetBranchPathParams export const GetBranch = ({ repo_ref, branch_name, ...props }: GetBranchProps) => ( path={`/repos/${repo_ref}/branches/${branch_name}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetBranchProps = Omit, 'path'> & GetBranchPathParams export const useGetBranch = ({ repo_ref, branch_name, ...props }: UseGetBranchProps) => useGet( (paramsInPath: GetBranchPathParams) => `/repos/${paramsInPath.repo_ref}/branches/${paramsInPath.branch_name}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, branch_name }, ...props } ) export interface ListStatusCheckResultsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListStatusCheckResultsPathParams { repo_ref: string commit_sha: string } export type ListStatusCheckResultsProps = Omit< GetProps, 'path' > & ListStatusCheckResultsPathParams export const ListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ListStatusCheckResultsProps) => ( path={`/repos/${repo_ref}/checks/commits/${commit_sha}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListStatusCheckResultsProps = Omit< UseGetProps, 'path' > & ListStatusCheckResultsPathParams export const useListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: UseListStatusCheckResultsProps) => useGet( (paramsInPath: ListStatusCheckResultsPathParams) => `/repos/${paramsInPath.repo_ref}/checks/commits/${paramsInPath.commit_sha}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, commit_sha }, ...props } ) export interface ReportStatusCheckResultsPathParams { repo_ref: string commit_sha: string } export interface ReportStatusCheckResultsRequestBody { check_uid?: string link?: string payload?: TypesCheckPayload status?: EnumCheckStatus summary?: string } export type ReportStatusCheckResultsProps = Omit< MutateProps< TypesCheck, UsererrorError, void, ReportStatusCheckResultsRequestBody, ReportStatusCheckResultsPathParams >, 'path' | 'verb' > & ReportStatusCheckResultsPathParams export const ReportStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ReportStatusCheckResultsProps) => ( verb="PUT" path={`/repos/${repo_ref}/checks/commits/${commit_sha}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseReportStatusCheckResultsProps = Omit< UseMutateProps< TypesCheck, UsererrorError, void, ReportStatusCheckResultsRequestBody, ReportStatusCheckResultsPathParams >, 'path' | 'verb' > & ReportStatusCheckResultsPathParams export const useReportStatusCheckResults = ({ repo_ref, commit_sha, ...props }: UseReportStatusCheckResultsProps) => useMutate( 'PUT', (paramsInPath: ReportStatusCheckResultsPathParams) => `/repos/${paramsInPath.repo_ref}/checks/commits/${paramsInPath.commit_sha}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, commit_sha }, ...props } ) export interface ListCommitsQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string /** * The result should only contain commits that occurred after the provided reference. */ after?: string /** * Path for which commit information should be retrieved */ path?: string /** * Epoch since when commit information should be retrieved. */ since?: number /** * Epoch until when commit information should be retrieved. */ until?: number /** * Committer pattern for which commit information should be retrieved. */ committer?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListCommitsPathParams { repo_ref: string } export type ListCommitsProps = Omit< GetProps, 'path' > & ListCommitsPathParams export const ListCommits = ({ repo_ref, ...props }: ListCommitsProps) => ( path={`/repos/${repo_ref}/commits`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListCommitsProps = Omit< UseGetProps, 'path' > & ListCommitsPathParams export const useListCommits = ({ repo_ref, ...props }: UseListCommitsProps) => useGet( (paramsInPath: ListCommitsPathParams) => `/repos/${paramsInPath.repo_ref}/commits`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CommitFilesPathParams { repo_ref: string } export type CommitFilesProps = Omit< MutateProps, 'path' | 'verb' > & CommitFilesPathParams export const CommitFiles = ({ repo_ref, ...props }: CommitFilesProps) => ( verb="POST" path={`/repos/${repo_ref}/commits`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCommitFilesProps = Omit< UseMutateProps, 'path' | 'verb' > & CommitFilesPathParams export const useCommitFiles = ({ repo_ref, ...props }: UseCommitFilesProps) => useMutate( 'POST', (paramsInPath: CommitFilesPathParams) => `/repos/${paramsInPath.repo_ref}/commits`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface GetCommitPathParams { repo_ref: string commit_sha: string } export type GetCommitProps = Omit, 'path'> & GetCommitPathParams export const GetCommit = ({ repo_ref, commit_sha, ...props }: GetCommitProps) => ( path={`/repos/${repo_ref}/commits/${commit_sha}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetCommitProps = Omit, 'path'> & GetCommitPathParams export const useGetCommit = ({ repo_ref, commit_sha, ...props }: UseGetCommitProps) => useGet( (paramsInPath: GetCommitPathParams) => `/repos/${paramsInPath.repo_ref}/commits/${paramsInPath.commit_sha}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, commit_sha }, ...props } ) export interface CalculateCommitDivergencePathParams { repo_ref: string } export type CalculateCommitDivergenceProps = Omit< MutateProps< RepoCommitDivergence[], UsererrorError, void, OpenapiCalculateCommitDivergenceRequest, CalculateCommitDivergencePathParams >, 'path' | 'verb' > & CalculateCommitDivergencePathParams export const CalculateCommitDivergence = ({ repo_ref, ...props }: CalculateCommitDivergenceProps) => ( verb="POST" path={`/repos/${repo_ref}/commits/calculate-divergence`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCalculateCommitDivergenceProps = Omit< UseMutateProps< RepoCommitDivergence[], UsererrorError, void, OpenapiCalculateCommitDivergenceRequest, CalculateCommitDivergencePathParams >, 'path' | 'verb' > & CalculateCommitDivergencePathParams export const useCalculateCommitDivergence = ({ repo_ref, ...props }: UseCalculateCommitDivergenceProps) => useMutate< RepoCommitDivergence[], UsererrorError, void, OpenapiCalculateCommitDivergenceRequest, CalculateCommitDivergencePathParams >( 'POST', (paramsInPath: CalculateCommitDivergencePathParams) => `/repos/${paramsInPath.repo_ref}/commits/calculate-divergence`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface GetContentQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string /** * Indicates whether optional commit information should be included in the response. */ include_commit?: boolean } export interface GetContentPathParams { repo_ref: string path: string } export type GetContentProps = Omit< GetProps, 'path' > & GetContentPathParams export const GetContent = ({ repo_ref, path, ...props }: GetContentProps) => ( path={`/repos/${repo_ref}/content/${path}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetContentProps = Omit< UseGetProps, 'path' > & GetContentPathParams export const useGetContent = ({ repo_ref, path, ...props }: UseGetContentProps) => useGet( (paramsInPath: GetContentPathParams) => `/repos/${paramsInPath.repo_ref}/content/${paramsInPath.path}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, path }, ...props } ) export interface DiffStatsPathParams { repo_ref: string range: string } export type DiffStatsProps = Omit, 'path'> & DiffStatsPathParams export const DiffStats = ({ repo_ref, range, ...props }: DiffStatsProps) => ( path={`/repos/${repo_ref}/diff-stats/${range}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDiffStatsProps = Omit, 'path'> & DiffStatsPathParams export const useDiffStats = ({ repo_ref, range, ...props }: UseDiffStatsProps) => useGet( (paramsInPath: DiffStatsPathParams) => `/repos/${paramsInPath.repo_ref}/diff-stats/${paramsInPath.range}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, range }, ...props } ) export interface RawDiffPathParams { repo_ref: string range: string } export type RawDiffProps = Omit, 'path'> & RawDiffPathParams export const RawDiff = ({ repo_ref, range, ...props }: RawDiffProps) => ( path={`/repos/${repo_ref}/diff/${range}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseRawDiffProps = Omit, 'path'> & RawDiffPathParams export const useRawDiff = ({ repo_ref, range, ...props }: UseRawDiffProps) => useGet( (paramsInPath: RawDiffPathParams) => `/repos/${paramsInPath.repo_ref}/diff/${paramsInPath.range}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, range }, ...props } ) export interface MergeCheckPathParams { repo_ref: string range: string } export type MergeCheckProps = Omit< MutateProps, 'path' | 'verb' > & MergeCheckPathParams export const MergeCheck = ({ repo_ref, range, ...props }: MergeCheckProps) => ( verb="POST" path={`/repos/${repo_ref}/merge-check/${range}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMergeCheckProps = Omit< UseMutateProps, 'path' | 'verb' > & MergeCheckPathParams export const useMergeCheck = ({ repo_ref, range, ...props }: UseMergeCheckProps) => useMutate( 'POST', (paramsInPath: MergeCheckPathParams) => `/repos/${paramsInPath.repo_ref}/merge-check/${paramsInPath.range}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, range }, ...props } ) export interface MoveRepositoryPathParams { repo_ref: string } export type MoveRepositoryProps = Omit< MutateProps, 'path' | 'verb' > & MoveRepositoryPathParams export const MoveRepository = ({ repo_ref, ...props }: MoveRepositoryProps) => ( verb="POST" path={`/repos/${repo_ref}/move`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMoveRepositoryProps = Omit< UseMutateProps, 'path' | 'verb' > & MoveRepositoryPathParams export const useMoveRepository = ({ repo_ref, ...props }: UseMoveRepositoryProps) => useMutate( 'POST', (paramsInPath: MoveRepositoryPathParams) => `/repos/${paramsInPath.repo_ref}/move`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface PathDetailsQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string } export interface PathDetailsPathParams { repo_ref: string } export type PathDetailsProps = Omit< MutateProps< RepoPathsDetailsOutput, UsererrorError, PathDetailsQueryParams, OpenapiPathsDetailsRequest, PathDetailsPathParams >, 'path' | 'verb' > & PathDetailsPathParams export const PathDetails = ({ repo_ref, ...props }: PathDetailsProps) => ( verb="POST" path={`/repos/${repo_ref}/path-details`} base={getConfig('code/api/v1')} {...props} /> ) export type UsePathDetailsProps = Omit< UseMutateProps< RepoPathsDetailsOutput, UsererrorError, PathDetailsQueryParams, OpenapiPathsDetailsRequest, PathDetailsPathParams >, 'path' | 'verb' > & PathDetailsPathParams export const usePathDetails = ({ repo_ref, ...props }: UsePathDetailsProps) => useMutate< RepoPathsDetailsOutput, UsererrorError, PathDetailsQueryParams, OpenapiPathsDetailsRequest, PathDetailsPathParams >('POST', (paramsInPath: PathDetailsPathParams) => `/repos/${paramsInPath.repo_ref}/path-details`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props }) export interface ListRepositoryPathsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListRepositoryPathsPathParams { repo_ref: string } export type ListRepositoryPathsProps = Omit< GetProps, 'path' > & ListRepositoryPathsPathParams export const ListRepositoryPaths = ({ repo_ref, ...props }: ListRepositoryPathsProps) => ( path={`/repos/${repo_ref}/paths`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListRepositoryPathsProps = Omit< UseGetProps, 'path' > & ListRepositoryPathsPathParams export const useListRepositoryPaths = ({ repo_ref, ...props }: UseListRepositoryPathsProps) => useGet( (paramsInPath: ListRepositoryPathsPathParams) => `/repos/${paramsInPath.repo_ref}/paths`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CreateRepositoryPathPathParams { repo_ref: string } export type CreateRepositoryPathProps = Omit< MutateProps, 'path' | 'verb' > & CreateRepositoryPathPathParams export const CreateRepositoryPath = ({ repo_ref, ...props }: CreateRepositoryPathProps) => ( verb="POST" path={`/repos/${repo_ref}/paths`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateRepositoryPathProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateRepositoryPathPathParams export const useCreateRepositoryPath = ({ repo_ref, ...props }: UseCreateRepositoryPathProps) => useMutate( 'POST', (paramsInPath: CreateRepositoryPathPathParams) => `/repos/${paramsInPath.repo_ref}/paths`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface DeleteRepositoryPathPathParams { repo_ref: string } export type DeleteRepositoryPathProps = Omit< MutateProps, 'path' | 'verb' > & DeleteRepositoryPathPathParams export const DeleteRepositoryPath = ({ repo_ref, ...props }: DeleteRepositoryPathProps) => ( verb="DELETE" path={`/repos/${repo_ref}/paths`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteRepositoryPathProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteRepositoryPathPathParams export const useDeleteRepositoryPath = ({ repo_ref, ...props }: UseDeleteRepositoryPathProps) => useMutate( 'DELETE', (paramsInPath: DeleteRepositoryPathPathParams) => `/repos/${paramsInPath.repo_ref}/paths`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface ListPipelinesQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number /** * Whether to fetch latest build information for each pipeline. */ latest?: boolean } export interface ListPipelinesPathParams { repo_ref: string } export type ListPipelinesProps = Omit< GetProps, 'path' > & ListPipelinesPathParams export const ListPipelines = ({ repo_ref, ...props }: ListPipelinesProps) => ( path={`/repos/${repo_ref}/pipelines`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPipelinesProps = Omit< UseGetProps, 'path' > & ListPipelinesPathParams export const useListPipelines = ({ repo_ref, ...props }: UseListPipelinesProps) => useGet( (paramsInPath: ListPipelinesPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CreatePipelinePathParams { repo_ref: string } export type CreatePipelineProps = Omit< MutateProps, 'path' | 'verb' > & CreatePipelinePathParams export const CreatePipeline = ({ repo_ref, ...props }: CreatePipelineProps) => ( verb="POST" path={`/repos/${repo_ref}/pipelines`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreatePipelineProps = Omit< UseMutateProps, 'path' | 'verb' > & CreatePipelinePathParams export const useCreatePipeline = ({ repo_ref, ...props }: UseCreatePipelineProps) => useMutate( 'POST', (paramsInPath: CreatePipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface DeletePipelinePathParams { repo_ref: string } export type DeletePipelineProps = Omit< MutateProps, 'path' | 'verb' > & DeletePipelinePathParams export const DeletePipeline = ({ repo_ref, ...props }: DeletePipelineProps) => ( verb="DELETE" path={`/repos/${repo_ref}/pipelines`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeletePipelineProps = Omit< UseMutateProps, 'path' | 'verb' > & DeletePipelinePathParams export const useDeletePipeline = ({ repo_ref, ...props }: UseDeletePipelineProps) => useMutate( 'DELETE', (paramsInPath: DeletePipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface FindPipelinePathParams { repo_ref: string pipeline_uid: string } export type FindPipelineProps = Omit, 'path'> & FindPipelinePathParams export const FindPipeline = ({ repo_ref, pipeline_uid, ...props }: FindPipelineProps) => ( path={`/repos/${repo_ref}/pipelines/${pipeline_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindPipelineProps = Omit< UseGetProps, 'path' > & FindPipelinePathParams export const useFindPipeline = ({ repo_ref, pipeline_uid, ...props }: UseFindPipelineProps) => useGet( (paramsInPath: FindPipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface UpdatePipelinePathParams { repo_ref: string pipeline_uid: string } export type UpdatePipelineProps = Omit< MutateProps, 'path' | 'verb' > & UpdatePipelinePathParams export const UpdatePipeline = ({ repo_ref, pipeline_uid, ...props }: UpdatePipelineProps) => ( verb="PATCH" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdatePipelineProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdatePipelinePathParams export const useUpdatePipeline = ({ repo_ref, pipeline_uid, ...props }: UseUpdatePipelineProps) => useMutate( 'PATCH', (paramsInPath: UpdatePipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface ListExecutionsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListExecutionsPathParams { repo_ref: string pipeline_uid: string } export type ListExecutionsProps = Omit< GetProps, 'path' > & ListExecutionsPathParams export const ListExecutions = ({ repo_ref, pipeline_uid, ...props }: ListExecutionsProps) => ( path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListExecutionsProps = Omit< UseGetProps, 'path' > & ListExecutionsPathParams export const useListExecutions = ({ repo_ref, pipeline_uid, ...props }: UseListExecutionsProps) => useGet( (paramsInPath: ListExecutionsPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface CreateExecutionPathParams { repo_ref: string pipeline_uid: string } export type CreateExecutionProps = Omit< MutateProps, 'path' | 'verb' > & CreateExecutionPathParams export const CreateExecution = ({ repo_ref, pipeline_uid, ...props }: CreateExecutionProps) => ( verb="POST" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateExecutionProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateExecutionPathParams export const useCreateExecution = ({ repo_ref, pipeline_uid, ...props }: UseCreateExecutionProps) => useMutate( 'POST', (paramsInPath: CreateExecutionPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface DeleteExecutionPathParams { repo_ref: string pipeline_uid: string } export type DeleteExecutionProps = Omit< MutateProps, 'path' | 'verb' > & DeleteExecutionPathParams export const DeleteExecution = ({ repo_ref, pipeline_uid, ...props }: DeleteExecutionProps) => ( verb="DELETE" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteExecutionProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteExecutionPathParams export const useDeleteExecution = ({ repo_ref, pipeline_uid, ...props }: UseDeleteExecutionProps) => useMutate( 'DELETE', (paramsInPath: DeleteExecutionPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface FindExecutionPathParams { repo_ref: string pipeline_uid: string execution_number: string } export type FindExecutionProps = Omit, 'path'> & FindExecutionPathParams export const FindExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: FindExecutionProps) => ( path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions/${execution_number}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindExecutionProps = Omit< UseGetProps, 'path' > & FindExecutionPathParams export const useFindExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: UseFindExecutionProps) => useGet( (paramsInPath: FindExecutionPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions/${paramsInPath.execution_number}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, execution_number }, ...props } ) export interface UpdateExecutionPathParams { repo_ref: string pipeline_uid: string execution_number: string } export type UpdateExecutionProps = Omit< MutateProps, 'path' | 'verb' > & UpdateExecutionPathParams export const UpdateExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: UpdateExecutionProps) => ( verb="PATCH" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions/${execution_number}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateExecutionProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateExecutionPathParams export const useUpdateExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: UseUpdateExecutionProps) => useMutate( 'PATCH', (paramsInPath: UpdateExecutionPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions/${paramsInPath.execution_number}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, execution_number }, ...props } ) export interface ViewLogsPathParams { repo_ref: string pipeline_uid: string execution_number: string stage_number: string step_number: string } export type ViewLogsProps = Omit, 'path'> & ViewLogsPathParams export const ViewLogs = ({ repo_ref, pipeline_uid, execution_number, stage_number, step_number, ...props }: ViewLogsProps) => ( path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions/${execution_number}/logs/${stage_number}/${step_number}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseViewLogsProps = Omit, 'path'> & ViewLogsPathParams export const useViewLogs = ({ repo_ref, pipeline_uid, execution_number, stage_number, step_number, ...props }: UseViewLogsProps) => useGet( (paramsInPath: ViewLogsPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions/${paramsInPath.execution_number}/logs/${paramsInPath.stage_number}/${paramsInPath.step_number}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, execution_number, stage_number, step_number }, ...props } ) export interface ListTriggersQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListTriggersPathParams { repo_ref: string pipeline_uid: string } export type ListTriggersProps = Omit< GetProps, 'path' > & ListTriggersPathParams export const ListTriggers = ({ repo_ref, pipeline_uid, ...props }: ListTriggersProps) => ( path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListTriggersProps = Omit< UseGetProps, 'path' > & ListTriggersPathParams export const useListTriggers = ({ repo_ref, pipeline_uid, ...props }: UseListTriggersProps) => useGet( (paramsInPath: ListTriggersPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface CreateTriggerPathParams { repo_ref: string pipeline_uid: string } export type CreateTriggerProps = Omit< MutateProps, 'path' | 'verb' > & CreateTriggerPathParams export const CreateTrigger = ({ repo_ref, pipeline_uid, ...props }: CreateTriggerProps) => ( verb="POST" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateTriggerProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateTriggerPathParams export const useCreateTrigger = ({ repo_ref, pipeline_uid, ...props }: UseCreateTriggerProps) => useMutate( 'POST', (paramsInPath: CreateTriggerPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface DeleteTriggerPathParams { repo_ref: string pipeline_uid: string } export type DeleteTriggerProps = Omit< MutateProps, 'path' | 'verb' > & DeleteTriggerPathParams export const DeleteTrigger = ({ repo_ref, pipeline_uid, ...props }: DeleteTriggerProps) => ( verb="DELETE" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteTriggerProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteTriggerPathParams export const useDeleteTrigger = ({ repo_ref, pipeline_uid, ...props }: UseDeleteTriggerProps) => useMutate( 'DELETE', (paramsInPath: DeleteTriggerPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } ) export interface FindTriggerPathParams { repo_ref: string pipeline_uid: string trigger_uid: string } export type FindTriggerProps = Omit, 'path'> & FindTriggerPathParams export const FindTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: FindTriggerProps) => ( path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers/${trigger_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindTriggerProps = Omit, 'path'> & FindTriggerPathParams export const useFindTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: UseFindTriggerProps) => useGet( (paramsInPath: FindTriggerPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers/${paramsInPath.trigger_uid}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, trigger_uid }, ...props } ) export interface UpdateTriggerPathParams { repo_ref: string pipeline_uid: string trigger_uid: string } export type UpdateTriggerProps = Omit< MutateProps, 'path' | 'verb' > & UpdateTriggerPathParams export const UpdateTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: UpdateTriggerProps) => ( verb="PATCH" path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers/${trigger_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateTriggerProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateTriggerPathParams export const useUpdateTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: UseUpdateTriggerProps) => useMutate( 'PATCH', (paramsInPath: UpdateTriggerPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers/${paramsInPath.trigger_uid}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, trigger_uid }, ...props } ) export interface ListPullReqQueryParams { /** * The state of the pull requests to include in the result. */ state?: ('closed' | 'merged' | 'open')[] /** * Source repository ref of the pull requests. */ source_repo_ref?: string /** * Source branch of the pull requests. */ source_branch?: string /** * Target branch of the pull requests. */ target_branch?: string /** * The substring by which the pull requests are filtered. */ query?: string /** * The principal ID who created pull requests. */ created_by?: number /** * The order of the output. */ order?: 'asc' | 'desc' /** * The data by which the pull requests are sorted. */ sort?: 'created' | 'edited' | 'merged' | 'number' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListPullReqPathParams { repo_ref: string } export type ListPullReqProps = Omit< GetProps, 'path' > & ListPullReqPathParams export const ListPullReq = ({ repo_ref, ...props }: ListPullReqProps) => ( path={`/repos/${repo_ref}/pullreq`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPullReqProps = Omit< UseGetProps, 'path' > & ListPullReqPathParams export const useListPullReq = ({ repo_ref, ...props }: UseListPullReqProps) => useGet( (paramsInPath: ListPullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CreatePullReqPathParams { repo_ref: string } export type CreatePullReqProps = Omit< MutateProps, 'path' | 'verb' > & CreatePullReqPathParams export const CreatePullReq = ({ repo_ref, ...props }: CreatePullReqProps) => ( verb="POST" path={`/repos/${repo_ref}/pullreq`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreatePullReqProps = Omit< UseMutateProps, 'path' | 'verb' > & CreatePullReqPathParams export const useCreatePullReq = ({ repo_ref, ...props }: UseCreatePullReqProps) => useMutate( 'POST', (paramsInPath: CreatePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface GetPullReqPathParams { repo_ref: string pullreq_number: number } export type GetPullReqProps = Omit, 'path'> & GetPullReqPathParams export const GetPullReq = ({ repo_ref, pullreq_number, ...props }: GetPullReqProps) => ( path={`/repos/${repo_ref}/pullreq/${pullreq_number}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetPullReqProps = Omit, 'path'> & GetPullReqPathParams export const useGetPullReq = ({ repo_ref, pullreq_number, ...props }: UseGetPullReqProps) => useGet( (paramsInPath: GetPullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface UpdatePullReqPathParams { repo_ref: string pullreq_number: number } export type UpdatePullReqProps = Omit< MutateProps, 'path' | 'verb' > & UpdatePullReqPathParams export const UpdatePullReq = ({ repo_ref, pullreq_number, ...props }: UpdatePullReqProps) => ( verb="PATCH" path={`/repos/${repo_ref}/pullreq/${pullreq_number}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdatePullReqProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdatePullReqPathParams export const useUpdatePullReq = ({ repo_ref, pullreq_number, ...props }: UseUpdatePullReqProps) => useMutate( 'PATCH', (paramsInPath: UpdatePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface ListPullReqActivitiesQueryParams { /** * The kind of the pull request activity to include in the result. */ kind?: ('change-comment' | 'comment' | 'system')[] /** * The type of the pull request activity to include in the result. */ type?: ( | 'branch-delete' | 'branch-update' | 'code-comment' | 'comment' | 'merge' | 'review-submit' | 'state-change' | 'title-change' )[] /** * The result should contain only entries created at and after this timestamp (unix millis). */ after?: number /** * The result should contain only entries created before this timestamp (unix millis). */ before?: number /** * The maximum number of results to return. */ limit?: number } export interface ListPullReqActivitiesPathParams { repo_ref: string pullreq_number: number } export type ListPullReqActivitiesProps = Omit< GetProps, 'path' > & ListPullReqActivitiesPathParams export const ListPullReqActivities = ({ repo_ref, pullreq_number, ...props }: ListPullReqActivitiesProps) => ( path={`/repos/${repo_ref}/pullreq/${pullreq_number}/activities`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPullReqActivitiesProps = Omit< UseGetProps< TypesPullReqActivity[], UsererrorError, ListPullReqActivitiesQueryParams, ListPullReqActivitiesPathParams >, 'path' > & ListPullReqActivitiesPathParams export const useListPullReqActivities = ({ repo_ref, pullreq_number, ...props }: UseListPullReqActivitiesProps) => useGet( (paramsInPath: ListPullReqActivitiesPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/activities`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface CommentCreatePullReqPathParams { repo_ref: string pullreq_number: number } export type CommentCreatePullReqProps = Omit< MutateProps< TypesPullReqActivity, UsererrorError, void, OpenapiCommentCreatePullReqRequest, CommentCreatePullReqPathParams >, 'path' | 'verb' > & CommentCreatePullReqPathParams export const CommentCreatePullReq = ({ repo_ref, pullreq_number, ...props }: CommentCreatePullReqProps) => ( verb="POST" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/comments`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCommentCreatePullReqProps = Omit< UseMutateProps< TypesPullReqActivity, UsererrorError, void, OpenapiCommentCreatePullReqRequest, CommentCreatePullReqPathParams >, 'path' | 'verb' > & CommentCreatePullReqPathParams export const useCommentCreatePullReq = ({ repo_ref, pullreq_number, ...props }: UseCommentCreatePullReqProps) => useMutate< TypesPullReqActivity, UsererrorError, void, OpenapiCommentCreatePullReqRequest, CommentCreatePullReqPathParams >( 'POST', (paramsInPath: CommentCreatePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/comments`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface CommentDeletePullReqPathParams { repo_ref: string pullreq_number: number } export type CommentDeletePullReqProps = Omit< MutateProps, 'path' | 'verb' > & CommentDeletePullReqPathParams export const CommentDeletePullReq = ({ repo_ref, pullreq_number, ...props }: CommentDeletePullReqProps) => ( verb="DELETE" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/comments`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCommentDeletePullReqProps = Omit< UseMutateProps, 'path' | 'verb' > & CommentDeletePullReqPathParams export const useCommentDeletePullReq = ({ repo_ref, pullreq_number, ...props }: UseCommentDeletePullReqProps) => useMutate( 'DELETE', (paramsInPath: CommentDeletePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/comments`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface CommentUpdatePullReqPathParams { repo_ref: string pullreq_number: number pullreq_comment_id: number } export type CommentUpdatePullReqProps = Omit< MutateProps< TypesPullReqActivity, UsererrorError, void, OpenapiCommentUpdatePullReqRequest, CommentUpdatePullReqPathParams >, 'path' | 'verb' > & CommentUpdatePullReqPathParams export const CommentUpdatePullReq = ({ repo_ref, pullreq_number, pullreq_comment_id, ...props }: CommentUpdatePullReqProps) => ( verb="PATCH" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/comments/${pullreq_comment_id}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCommentUpdatePullReqProps = Omit< UseMutateProps< TypesPullReqActivity, UsererrorError, void, OpenapiCommentUpdatePullReqRequest, CommentUpdatePullReqPathParams >, 'path' | 'verb' > & CommentUpdatePullReqPathParams export const useCommentUpdatePullReq = ({ repo_ref, pullreq_number, pullreq_comment_id, ...props }: UseCommentUpdatePullReqProps) => useMutate< TypesPullReqActivity, UsererrorError, void, OpenapiCommentUpdatePullReqRequest, CommentUpdatePullReqPathParams >( 'PATCH', (paramsInPath: CommentUpdatePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/comments/${paramsInPath.pullreq_comment_id}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number, pullreq_comment_id }, ...props } ) export interface CommentStatusPullReqPathParams { repo_ref: string pullreq_number: number pullreq_comment_id: number } export type CommentStatusPullReqProps = Omit< MutateProps< TypesPullReqActivity, UsererrorError, void, OpenapiCommentStatusPullReqRequest, CommentStatusPullReqPathParams >, 'path' | 'verb' > & CommentStatusPullReqPathParams export const CommentStatusPullReq = ({ repo_ref, pullreq_number, pullreq_comment_id, ...props }: CommentStatusPullReqProps) => ( verb="PUT" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/comments/${pullreq_comment_id}/status`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCommentStatusPullReqProps = Omit< UseMutateProps< TypesPullReqActivity, UsererrorError, void, OpenapiCommentStatusPullReqRequest, CommentStatusPullReqPathParams >, 'path' | 'verb' > & CommentStatusPullReqPathParams export const useCommentStatusPullReq = ({ repo_ref, pullreq_number, pullreq_comment_id, ...props }: UseCommentStatusPullReqProps) => useMutate< TypesPullReqActivity, UsererrorError, void, OpenapiCommentStatusPullReqRequest, CommentStatusPullReqPathParams >( 'PUT', (paramsInPath: CommentStatusPullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/comments/${paramsInPath.pullreq_comment_id}/status`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number, pullreq_comment_id }, ...props } ) export interface ListPullReqCommitsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListPullReqCommitsPathParams { repo_ref: string pullreq_number: number } export type ListPullReqCommitsProps = Omit< GetProps, 'path' > & ListPullReqCommitsPathParams export const ListPullReqCommits = ({ repo_ref, pullreq_number, ...props }: ListPullReqCommitsProps) => ( path={`/repos/${repo_ref}/pullreq/${pullreq_number}/commits`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPullReqCommitsProps = Omit< UseGetProps, 'path' > & ListPullReqCommitsPathParams export const useListPullReqCommits = ({ repo_ref, pullreq_number, ...props }: UseListPullReqCommitsProps) => useGet( (paramsInPath: ListPullReqCommitsPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/commits`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface MergePullReqOpPathParams { repo_ref: string pullreq_number: number } export type MergePullReqOpProps = Omit< MutateProps, 'path' | 'verb' > & MergePullReqOpPathParams export const MergePullReqOp = ({ repo_ref, pullreq_number, ...props }: MergePullReqOpProps) => ( verb="POST" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/merge`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMergePullReqOpProps = Omit< UseMutateProps, 'path' | 'verb' > & MergePullReqOpPathParams export const useMergePullReqOp = ({ repo_ref, pullreq_number, ...props }: UseMergePullReqOpProps) => useMutate( 'POST', (paramsInPath: MergePullReqOpPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/merge`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface PullReqMetaDataPathParams { repo_ref: string pullreq_number: number } export type PullReqMetaDataProps = Omit< GetProps, 'path' > & PullReqMetaDataPathParams export const PullReqMetaData = ({ repo_ref, pullreq_number, ...props }: PullReqMetaDataProps) => ( path={`/repos/${repo_ref}/pullreq/${pullreq_number}/metadata`} base={getConfig('code/api/v1')} {...props} /> ) export type UsePullReqMetaDataProps = Omit< UseGetProps, 'path' > & PullReqMetaDataPathParams export const usePullReqMetaData = ({ repo_ref, pullreq_number, ...props }: UsePullReqMetaDataProps) => useGet( (paramsInPath: PullReqMetaDataPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/metadata`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface ReviewerListPullReqPathParams { repo_ref: string pullreq_number: number } export type ReviewerListPullReqProps = Omit< GetProps, 'path' > & ReviewerListPullReqPathParams export const ReviewerListPullReq = ({ repo_ref, pullreq_number, ...props }: ReviewerListPullReqProps) => ( path={`/repos/${repo_ref}/pullreq/${pullreq_number}/reviewers`} base={getConfig('code/api/v1')} {...props} /> ) export type UseReviewerListPullReqProps = Omit< UseGetProps, 'path' > & ReviewerListPullReqPathParams export const useReviewerListPullReq = ({ repo_ref, pullreq_number, ...props }: UseReviewerListPullReqProps) => useGet( (paramsInPath: ReviewerListPullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/reviewers`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface ReviewerAddPullReqPathParams { repo_ref: string pullreq_number: number } export type ReviewerAddPullReqProps = Omit< MutateProps< TypesPullReqReviewer, UsererrorError, void, OpenapiReviewerAddPullReqRequest, ReviewerAddPullReqPathParams >, 'path' | 'verb' > & ReviewerAddPullReqPathParams export const ReviewerAddPullReq = ({ repo_ref, pullreq_number, ...props }: ReviewerAddPullReqProps) => ( verb="PUT" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/reviewers`} base={getConfig('code/api/v1')} {...props} /> ) export type UseReviewerAddPullReqProps = Omit< UseMutateProps< TypesPullReqReviewer, UsererrorError, void, OpenapiReviewerAddPullReqRequest, ReviewerAddPullReqPathParams >, 'path' | 'verb' > & ReviewerAddPullReqPathParams export const useReviewerAddPullReq = ({ repo_ref, pullreq_number, ...props }: UseReviewerAddPullReqProps) => useMutate( 'PUT', (paramsInPath: ReviewerAddPullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/reviewers`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface ReviewerDeletePullReqPathParams { repo_ref: string pullreq_number: number } export type ReviewerDeletePullReqProps = Omit< MutateProps, 'path' | 'verb' > & ReviewerDeletePullReqPathParams export const ReviewerDeletePullReq = ({ repo_ref, pullreq_number, ...props }: ReviewerDeletePullReqProps) => ( verb="DELETE" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/reviewers`} base={getConfig('code/api/v1')} {...props} /> ) export type UseReviewerDeletePullReqProps = Omit< UseMutateProps, 'path' | 'verb' > & ReviewerDeletePullReqPathParams export const useReviewerDeletePullReq = ({ repo_ref, pullreq_number, ...props }: UseReviewerDeletePullReqProps) => useMutate( 'DELETE', (paramsInPath: ReviewerDeletePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/reviewers`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface ReviewSubmitPullReqPathParams { repo_ref: string pullreq_number: number } export type ReviewSubmitPullReqProps = Omit< MutateProps, 'path' | 'verb' > & ReviewSubmitPullReqPathParams export const ReviewSubmitPullReq = ({ repo_ref, pullreq_number, ...props }: ReviewSubmitPullReqProps) => ( verb="POST" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/reviews`} base={getConfig('code/api/v1')} {...props} /> ) export type UseReviewSubmitPullReqProps = Omit< UseMutateProps, 'path' | 'verb' > & ReviewSubmitPullReqPathParams export const useReviewSubmitPullReq = ({ repo_ref, pullreq_number, ...props }: UseReviewSubmitPullReqProps) => useMutate( 'POST', (paramsInPath: ReviewSubmitPullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/reviews`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface StatePullReqPathParams { repo_ref: string pullreq_number: number } export type StatePullReqProps = Omit< MutateProps, 'path' | 'verb' > & StatePullReqPathParams export const StatePullReq = ({ repo_ref, pullreq_number, ...props }: StatePullReqProps) => ( verb="POST" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/state`} base={getConfig('code/api/v1')} {...props} /> ) export type UseStatePullReqProps = Omit< UseMutateProps, 'path' | 'verb' > & StatePullReqPathParams export const useStatePullReq = ({ repo_ref, pullreq_number, ...props }: UseStatePullReqProps) => useMutate( 'POST', (paramsInPath: StatePullReqPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/state`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, pullreq_number }, ...props } ) export interface GetRawQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string } export interface GetRawPathParams { repo_ref: string path: string } export type GetRawProps = Omit, 'path'> & GetRawPathParams export const GetRaw = ({ repo_ref, path, ...props }: GetRawProps) => ( path={`/repos/${repo_ref}/raw/${path}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetRawProps = Omit, 'path'> & GetRawPathParams export const useGetRaw = ({ repo_ref, path, ...props }: UseGetRawProps) => useGet( (paramsInPath: GetRawPathParams) => `/repos/${paramsInPath.repo_ref}/raw/${paramsInPath.path}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, path }, ...props } ) export interface ListRepositoryServiceAccountsPathParams { repo_ref: string } export type ListRepositoryServiceAccountsProps = Omit< GetProps, 'path' > & ListRepositoryServiceAccountsPathParams export const ListRepositoryServiceAccounts = ({ repo_ref, ...props }: ListRepositoryServiceAccountsProps) => ( path={`/repos/${repo_ref}/service-accounts`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListRepositoryServiceAccountsProps = Omit< UseGetProps, 'path' > & ListRepositoryServiceAccountsPathParams export const useListRepositoryServiceAccounts = ({ repo_ref, ...props }: UseListRepositoryServiceAccountsProps) => useGet( (paramsInPath: ListRepositoryServiceAccountsPathParams) => `/repos/${paramsInPath.repo_ref}/service-accounts`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface ListTagsQueryParams { /** * Indicates whether optional commit information should be included in the response. */ include_commit?: boolean /** * The substring by which the tags are filtered. */ query?: string /** * The order of the output. */ order?: 'asc' | 'desc' /** * The data by which the tags are sorted. */ sort?: 'name' | 'date' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListTagsPathParams { repo_ref: string } export type ListTagsProps = Omit< GetProps, 'path' > & ListTagsPathParams export const ListTags = ({ repo_ref, ...props }: ListTagsProps) => ( path={`/repos/${repo_ref}/tags`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListTagsProps = Omit< UseGetProps, 'path' > & ListTagsPathParams export const useListTags = ({ repo_ref, ...props }: UseListTagsProps) => useGet( (paramsInPath: ListTagsPathParams) => `/repos/${paramsInPath.repo_ref}/tags`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CreateTagPathParams { repo_ref: string } export type CreateTagProps = Omit< MutateProps, 'path' | 'verb' > & CreateTagPathParams export const CreateTag = ({ repo_ref, ...props }: CreateTagProps) => ( verb="POST" path={`/repos/${repo_ref}/tags`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateTagProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateTagPathParams export const useCreateTag = ({ repo_ref, ...props }: UseCreateTagProps) => useMutate( 'POST', (paramsInPath: CreateTagPathParams) => `/repos/${paramsInPath.repo_ref}/tags`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface DeleteTagPathParams { repo_ref: string } export type DeleteTagProps = Omit< MutateProps, 'path' | 'verb' > & DeleteTagPathParams export const DeleteTag = ({ repo_ref, ...props }: DeleteTagProps) => ( verb="DELETE" path={`/repos/${repo_ref}/tags`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteTagProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteTagPathParams export const useDeleteTag = ({ repo_ref, ...props }: UseDeleteTagProps) => useMutate( 'DELETE', (paramsInPath: DeleteTagPathParams) => `/repos/${paramsInPath.repo_ref}/tags`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface ListWebhooksQueryParams { /** * The substring which is used to filter the spaces by their path name. */ query?: string /** * The data by which the webhooks are sorted. */ sort?: 'id' | 'display_name' | 'created' | 'updated' /** * The order of the output. */ order?: 'asc' | 'desc' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListWebhooksPathParams { repo_ref: string } export type ListWebhooksProps = Omit< GetProps, 'path' > & ListWebhooksPathParams export const ListWebhooks = ({ repo_ref, ...props }: ListWebhooksProps) => ( path={`/repos/${repo_ref}/webhooks`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListWebhooksProps = Omit< UseGetProps, 'path' > & ListWebhooksPathParams export const useListWebhooks = ({ repo_ref, ...props }: UseListWebhooksProps) => useGet( (paramsInPath: ListWebhooksPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface CreateWebhookPathParams { repo_ref: string } export type CreateWebhookProps = Omit< MutateProps, 'path' | 'verb' > & CreateWebhookPathParams export const CreateWebhook = ({ repo_ref, ...props }: CreateWebhookProps) => ( verb="POST" path={`/repos/${repo_ref}/webhooks`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateWebhookProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateWebhookPathParams export const useCreateWebhook = ({ repo_ref, ...props }: UseCreateWebhookProps) => useMutate( 'POST', (paramsInPath: CreateWebhookPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface DeleteWebhookPathParams { repo_ref: string } export type DeleteWebhookProps = Omit< MutateProps, 'path' | 'verb' > & DeleteWebhookPathParams export const DeleteWebhook = ({ repo_ref, ...props }: DeleteWebhookProps) => ( verb="DELETE" path={`/repos/${repo_ref}/webhooks`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteWebhookProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteWebhookPathParams export const useDeleteWebhook = ({ repo_ref, ...props }: UseDeleteWebhookProps) => useMutate( 'DELETE', (paramsInPath: DeleteWebhookPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks`, { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) export interface GetWebhookPathParams { repo_ref: string webhook_id: number } export type GetWebhookProps = Omit, 'path'> & GetWebhookPathParams export const GetWebhook = ({ repo_ref, webhook_id, ...props }: GetWebhookProps) => ( path={`/repos/${repo_ref}/webhooks/${webhook_id}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetWebhookProps = Omit< UseGetProps, 'path' > & GetWebhookPathParams export const useGetWebhook = ({ repo_ref, webhook_id, ...props }: UseGetWebhookProps) => useGet( (paramsInPath: GetWebhookPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks/${paramsInPath.webhook_id}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, webhook_id }, ...props } ) export interface UpdateWebhookPathParams { repo_ref: string webhook_id: number } export type UpdateWebhookProps = Omit< MutateProps, 'path' | 'verb' > & UpdateWebhookPathParams export const UpdateWebhook = ({ repo_ref, webhook_id, ...props }: UpdateWebhookProps) => ( verb="PATCH" path={`/repos/${repo_ref}/webhooks/${webhook_id}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateWebhookProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateWebhookPathParams export const useUpdateWebhook = ({ repo_ref, webhook_id, ...props }: UseUpdateWebhookProps) => useMutate( 'PATCH', (paramsInPath: UpdateWebhookPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks/${paramsInPath.webhook_id}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, webhook_id }, ...props } ) export interface ListWebhookExecutionsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListWebhookExecutionsPathParams { repo_ref: string webhook_id: number } export type ListWebhookExecutionsProps = Omit< GetProps, 'path' > & ListWebhookExecutionsPathParams export const ListWebhookExecutions = ({ repo_ref, webhook_id, ...props }: ListWebhookExecutionsProps) => ( path={`/repos/${repo_ref}/webhooks/${webhook_id}/executions`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListWebhookExecutionsProps = Omit< UseGetProps< TypesWebhookExecution[], UsererrorError, ListWebhookExecutionsQueryParams, ListWebhookExecutionsPathParams >, 'path' > & ListWebhookExecutionsPathParams export const useListWebhookExecutions = ({ repo_ref, webhook_id, ...props }: UseListWebhookExecutionsProps) => useGet( (paramsInPath: ListWebhookExecutionsPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks/${paramsInPath.webhook_id}/executions`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, webhook_id }, ...props } ) export interface GetWebhookExecutionQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface GetWebhookExecutionPathParams { repo_ref: string webhook_id: number webhook_execution_id: number } export type GetWebhookExecutionProps = Omit< GetProps, 'path' > & GetWebhookExecutionPathParams export const GetWebhookExecution = ({ repo_ref, webhook_id, webhook_execution_id, ...props }: GetWebhookExecutionProps) => ( path={`/repos/${repo_ref}/webhooks/${webhook_id}/executions/${webhook_execution_id}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetWebhookExecutionProps = Omit< UseGetProps, 'path' > & GetWebhookExecutionPathParams export const useGetWebhookExecution = ({ repo_ref, webhook_id, webhook_execution_id, ...props }: UseGetWebhookExecutionProps) => useGet( (paramsInPath: GetWebhookExecutionPathParams) => `/repos/${paramsInPath.repo_ref}/webhooks/${paramsInPath.webhook_id}/executions/${paramsInPath.webhook_execution_id}`, { base: getConfig('code/api/v1'), pathParams: { repo_ref, webhook_id, webhook_execution_id }, ...props } ) export type ListGitignoreProps = Omit, 'path'> export const ListGitignore = (props: ListGitignoreProps) => ( path={`/resources/gitignore`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListGitignoreProps = Omit, 'path'> export const useListGitignore = (props: UseListGitignoreProps) => useGet(`/resources/gitignore`, { base: getConfig('code/api/v1'), ...props }) export interface ListLicensesResponse { label?: string value?: string } ;[] export type ListLicensesProps = Omit, 'path'> export const ListLicenses = (props: ListLicensesProps) => ( path={`/resources/license`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListLicensesProps = Omit, 'path'> export const useListLicenses = (props: UseListLicensesProps) => useGet(`/resources/license`, { base: getConfig('code/api/v1'), ...props }) export type CreateSecretProps = Omit< MutateProps, 'path' | 'verb' > export const CreateSecret = (props: CreateSecretProps) => ( verb="POST" path={`/secrets`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateSecretProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateSecret = (props: UseCreateSecretProps) => useMutate('POST', `/secrets`, { base: getConfig('code/api/v1'), ...props }) export type DeleteSecretProps = Omit, 'path' | 'verb'> export const DeleteSecret = (props: DeleteSecretProps) => ( verb="DELETE" path={`/secrets`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteSecretProps = Omit, 'path' | 'verb'> export const useDeleteSecret = (props: UseDeleteSecretProps) => useMutate('DELETE', `/secrets`, { base: getConfig('code/api/v1'), ...props }) export interface FindSecretPathParams { secret_ref: string } export type FindSecretProps = Omit, 'path'> & FindSecretPathParams export const FindSecret = ({ secret_ref, ...props }: FindSecretProps) => ( path={`/secrets/${secret_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindSecretProps = Omit, 'path'> & FindSecretPathParams export const useFindSecret = ({ secret_ref, ...props }: UseFindSecretProps) => useGet( (paramsInPath: FindSecretPathParams) => `/secrets/${paramsInPath.secret_ref}`, { base: getConfig('code/api/v1'), pathParams: { secret_ref }, ...props } ) export interface UpdateSecretPathParams { secret_ref: string } export type UpdateSecretProps = Omit< MutateProps, 'path' | 'verb' > & UpdateSecretPathParams export const UpdateSecret = ({ secret_ref, ...props }: UpdateSecretProps) => ( verb="PATCH" path={`/secrets/${secret_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateSecretProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateSecretPathParams export const useUpdateSecret = ({ secret_ref, ...props }: UseUpdateSecretProps) => useMutate( 'PATCH', (paramsInPath: UpdateSecretPathParams) => `/secrets/${paramsInPath.secret_ref}`, { base: getConfig('code/api/v1'), pathParams: { secret_ref }, ...props } ) export type CreateSpaceProps = Omit< MutateProps, 'path' | 'verb' > export const CreateSpace = (props: CreateSpaceProps) => ( verb="POST" path={`/spaces`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateSpaceProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateSpace = (props: UseCreateSpaceProps) => useMutate('POST', `/spaces`, { base: getConfig('code/api/v1'), ...props }) export type DeleteSpaceProps = Omit, 'path' | 'verb'> export const DeleteSpace = (props: DeleteSpaceProps) => ( verb="DELETE" path={`/spaces`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteSpaceProps = Omit, 'path' | 'verb'> export const useDeleteSpace = (props: UseDeleteSpaceProps) => useMutate('DELETE', `/spaces`, { base: getConfig('code/api/v1'), ...props }) export interface GetSpacePathParams { space_ref: string } export type GetSpaceProps = Omit, 'path'> & GetSpacePathParams export const GetSpace = ({ space_ref, ...props }: GetSpaceProps) => ( path={`/spaces/${space_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetSpaceProps = Omit, 'path'> & GetSpacePathParams export const useGetSpace = ({ space_ref, ...props }: UseGetSpaceProps) => useGet( (paramsInPath: GetSpacePathParams) => `/spaces/${paramsInPath.space_ref}`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface UpdateSpacePathParams { space_ref: string } export type UpdateSpaceProps = Omit< MutateProps, 'path' | 'verb' > & UpdateSpacePathParams export const UpdateSpace = ({ space_ref, ...props }: UpdateSpaceProps) => ( verb="PATCH" path={`/spaces/${space_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateSpaceProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateSpacePathParams export const useUpdateSpace = ({ space_ref, ...props }: UseUpdateSpaceProps) => useMutate( 'PATCH', (paramsInPath: UpdateSpacePathParams) => `/spaces/${paramsInPath.space_ref}`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListConnectorsQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListConnectorsPathParams { space_ref: string } export type ListConnectorsProps = Omit< GetProps, 'path' > & ListConnectorsPathParams export const ListConnectors = ({ space_ref, ...props }: ListConnectorsProps) => ( path={`/spaces/${space_ref}/connectors`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListConnectorsProps = Omit< UseGetProps, 'path' > & ListConnectorsPathParams export const useListConnectors = ({ space_ref, ...props }: UseListConnectorsProps) => useGet( (paramsInPath: ListConnectorsPathParams) => `/spaces/${paramsInPath.space_ref}/connectors`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface MembershipListQueryParams { /** * The substring by which the space members are filtered. */ query?: string /** * The order of the output. */ order?: 'asc' | 'desc' /** * The field by which the space members are sorted. */ sort?: 'created' | 'name' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface MembershipListPathParams { space_ref: string } export type MembershipListProps = Omit< GetProps, 'path' > & MembershipListPathParams export const MembershipList = ({ space_ref, ...props }: MembershipListProps) => ( path={`/spaces/${space_ref}/members`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMembershipListProps = Omit< UseGetProps, 'path' > & MembershipListPathParams export const useMembershipList = ({ space_ref, ...props }: UseMembershipListProps) => useGet( (paramsInPath: MembershipListPathParams) => `/spaces/${paramsInPath.space_ref}/members`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface MembershipAddPathParams { space_ref: string } export interface MembershipAddRequestBody { role?: EnumMembershipRole user_uid?: string } export type MembershipAddProps = Omit< MutateProps, 'path' | 'verb' > & MembershipAddPathParams export const MembershipAdd = ({ space_ref, ...props }: MembershipAddProps) => ( verb="POST" path={`/spaces/${space_ref}/members`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMembershipAddProps = Omit< UseMutateProps, 'path' | 'verb' > & MembershipAddPathParams export const useMembershipAdd = ({ space_ref, ...props }: UseMembershipAddProps) => useMutate( 'POST', (paramsInPath: MembershipAddPathParams) => `/spaces/${paramsInPath.space_ref}/members`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface MembershipDeletePathParams { space_ref: string } export type MembershipDeleteProps = Omit< MutateProps, 'path' | 'verb' > & MembershipDeletePathParams export const MembershipDelete = ({ space_ref, ...props }: MembershipDeleteProps) => ( verb="DELETE" path={`/spaces/${space_ref}/members`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMembershipDeleteProps = Omit< UseMutateProps, 'path' | 'verb' > & MembershipDeletePathParams export const useMembershipDelete = ({ space_ref, ...props }: UseMembershipDeleteProps) => useMutate( 'DELETE', (paramsInPath: MembershipDeletePathParams) => `/spaces/${paramsInPath.space_ref}/members`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface MembershipUpdatePathParams { space_ref: string user_uid: string } export interface MembershipUpdateRequestBody { role?: EnumMembershipRole } export type MembershipUpdateProps = Omit< MutateProps, 'path' | 'verb' > & MembershipUpdatePathParams export const MembershipUpdate = ({ space_ref, user_uid, ...props }: MembershipUpdateProps) => ( verb="PATCH" path={`/spaces/${space_ref}/members/${user_uid}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMembershipUpdateProps = Omit< UseMutateProps, 'path' | 'verb' > & MembershipUpdatePathParams export const useMembershipUpdate = ({ space_ref, user_uid, ...props }: UseMembershipUpdateProps) => useMutate( 'PATCH', (paramsInPath: MembershipUpdatePathParams) => `/spaces/${paramsInPath.space_ref}/members/${paramsInPath.user_uid}`, { base: getConfig('code/api/v1'), pathParams: { space_ref, user_uid }, ...props } ) export interface MoveSpacePathParams { space_ref: string } export type MoveSpaceProps = Omit< MutateProps, 'path' | 'verb' > & MoveSpacePathParams export const MoveSpace = ({ space_ref, ...props }: MoveSpaceProps) => ( verb="POST" path={`/spaces/${space_ref}/move`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMoveSpaceProps = Omit< UseMutateProps, 'path' | 'verb' > & MoveSpacePathParams export const useMoveSpace = ({ space_ref, ...props }: UseMoveSpaceProps) => useMutate( 'POST', (paramsInPath: MoveSpacePathParams) => `/spaces/${paramsInPath.space_ref}/move`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListPathsQueryParams { /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListPathsPathParams { space_ref: string } export type ListPathsProps = Omit< GetProps, 'path' > & ListPathsPathParams export const ListPaths = ({ space_ref, ...props }: ListPathsProps) => ( path={`/spaces/${space_ref}/paths`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListPathsProps = Omit< UseGetProps, 'path' > & ListPathsPathParams export const useListPaths = ({ space_ref, ...props }: UseListPathsProps) => useGet( (paramsInPath: ListPathsPathParams) => `/spaces/${paramsInPath.space_ref}/paths`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface CreatePathPathParams { space_ref: string } export type CreatePathProps = Omit< MutateProps, 'path' | 'verb' > & CreatePathPathParams export const CreatePath = ({ space_ref, ...props }: CreatePathProps) => ( verb="POST" path={`/spaces/${space_ref}/paths`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreatePathProps = Omit< UseMutateProps, 'path' | 'verb' > & CreatePathPathParams export const useCreatePath = ({ space_ref, ...props }: UseCreatePathProps) => useMutate( 'POST', (paramsInPath: CreatePathPathParams) => `/spaces/${paramsInPath.space_ref}/paths`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface DeletePathPathParams { space_ref: string } export type DeletePathProps = Omit< MutateProps, 'path' | 'verb' > & DeletePathPathParams export const DeletePath = ({ space_ref, ...props }: DeletePathProps) => ( verb="DELETE" path={`/spaces/${space_ref}/paths`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeletePathProps = Omit< UseMutateProps, 'path' | 'verb' > & DeletePathPathParams export const useDeletePath = ({ space_ref, ...props }: UseDeletePathProps) => useMutate( 'DELETE', (paramsInPath: DeletePathPathParams) => `/spaces/${paramsInPath.space_ref}/paths`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListReposQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The data by which the repositories are sorted. */ sort?: 'uid' | 'path' | 'created' | 'updated' /** * The order of the output. */ order?: 'asc' | 'desc' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListReposPathParams { space_ref: string } export type ListReposProps = Omit< GetProps, 'path' > & ListReposPathParams export const ListRepos = ({ space_ref, ...props }: ListReposProps) => ( path={`/spaces/${space_ref}/repos`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListReposProps = Omit< UseGetProps, 'path' > & ListReposPathParams export const useListRepos = ({ space_ref, ...props }: UseListReposProps) => useGet( (paramsInPath: ListReposPathParams) => `/spaces/${paramsInPath.space_ref}/repos`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListSecretsQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListSecretsPathParams { space_ref: string } export type ListSecretsProps = Omit< GetProps, 'path' > & ListSecretsPathParams export const ListSecrets = ({ space_ref, ...props }: ListSecretsProps) => ( path={`/spaces/${space_ref}/secrets`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListSecretsProps = Omit< UseGetProps, 'path' > & ListSecretsPathParams export const useListSecrets = ({ space_ref, ...props }: UseListSecretsProps) => useGet( (paramsInPath: ListSecretsPathParams) => `/spaces/${paramsInPath.space_ref}/secrets`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListServiceAccountsPathParams { space_ref: string } export type ListServiceAccountsProps = Omit< GetProps, 'path' > & ListServiceAccountsPathParams export const ListServiceAccounts = ({ space_ref, ...props }: ListServiceAccountsProps) => ( path={`/spaces/${space_ref}/service-accounts`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListServiceAccountsProps = Omit< UseGetProps, 'path' > & ListServiceAccountsPathParams export const useListServiceAccounts = ({ space_ref, ...props }: UseListServiceAccountsProps) => useGet( (paramsInPath: ListServiceAccountsPathParams) => `/spaces/${paramsInPath.space_ref}/service-accounts`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListSpacesQueryParams { /** * The substring which is used to filter the spaces by their path name. */ query?: string /** * The data by which the spaces are sorted. */ sort?: 'uid' | 'path' | 'created' | 'updated' /** * The order of the output. */ order?: 'asc' | 'desc' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListSpacesPathParams { space_ref: string } export type ListSpacesProps = Omit< GetProps, 'path' > & ListSpacesPathParams export const ListSpaces = ({ space_ref, ...props }: ListSpacesProps) => ( path={`/spaces/${space_ref}/spaces`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListSpacesProps = Omit< UseGetProps, 'path' > & ListSpacesPathParams export const useListSpaces = ({ space_ref, ...props }: UseListSpacesProps) => useGet( (paramsInPath: ListSpacesPathParams) => `/spaces/${paramsInPath.space_ref}/spaces`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export interface ListTemplatesQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export interface ListTemplatesPathParams { space_ref: string } export type ListTemplatesProps = Omit< GetProps, 'path' > & ListTemplatesPathParams export const ListTemplates = ({ space_ref, ...props }: ListTemplatesProps) => ( path={`/spaces/${space_ref}/templates`} base={getConfig('code/api/v1')} {...props} /> ) export type UseListTemplatesProps = Omit< UseGetProps, 'path' > & ListTemplatesPathParams export const useListTemplates = ({ space_ref, ...props }: UseListTemplatesProps) => useGet( (paramsInPath: ListTemplatesPathParams) => `/spaces/${paramsInPath.space_ref}/templates`, { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) export type GetSystemConfigProps = Omit, 'path'> export const GetSystemConfig = (props: GetSystemConfigProps) => ( path={`/system/config`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetSystemConfigProps = Omit, 'path'> export const useGetSystemConfig = (props: UseGetSystemConfigProps) => useGet(`/system/config`, { base: getConfig('code/api/v1'), ...props }) export type CreateTemplateProps = Omit< MutateProps, 'path' | 'verb' > export const CreateTemplate = (props: CreateTemplateProps) => ( verb="POST" path={`/templates`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateTemplateProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateTemplate = (props: UseCreateTemplateProps) => useMutate('POST', `/templates`, { base: getConfig('code/api/v1'), ...props }) export type DeleteTemplateProps = Omit, 'path' | 'verb'> export const DeleteTemplate = (props: DeleteTemplateProps) => ( verb="DELETE" path={`/templates`} base={getConfig('code/api/v1')} {...props} /> ) export type UseDeleteTemplateProps = Omit, 'path' | 'verb'> export const useDeleteTemplate = (props: UseDeleteTemplateProps) => useMutate('DELETE', `/templates`, { base: getConfig('code/api/v1'), ...props }) export interface FindTemplatePathParams { template_ref: string } export type FindTemplateProps = Omit, 'path'> & FindTemplatePathParams export const FindTemplate = ({ template_ref, ...props }: FindTemplateProps) => ( path={`/templates/${template_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseFindTemplateProps = Omit< UseGetProps, 'path' > & FindTemplatePathParams export const useFindTemplate = ({ template_ref, ...props }: UseFindTemplateProps) => useGet( (paramsInPath: FindTemplatePathParams) => `/templates/${paramsInPath.template_ref}`, { base: getConfig('code/api/v1'), pathParams: { template_ref }, ...props } ) export interface UpdateTemplatePathParams { template_ref: string } export type UpdateTemplateProps = Omit< MutateProps, 'path' | 'verb' > & UpdateTemplatePathParams export const UpdateTemplate = ({ template_ref, ...props }: UpdateTemplateProps) => ( verb="PATCH" path={`/templates/${template_ref}`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateTemplateProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateTemplatePathParams export const useUpdateTemplate = ({ template_ref, ...props }: UseUpdateTemplateProps) => useMutate( 'PATCH', (paramsInPath: UpdateTemplatePathParams) => `/templates/${paramsInPath.template_ref}`, { base: getConfig('code/api/v1'), pathParams: { template_ref }, ...props } ) export type GetUserProps = Omit, 'path'> export const GetUser = (props: GetUserProps) => ( path={`/user`} base={getConfig('code/api/v1')} {...props} /> ) export type UseGetUserProps = Omit, 'path'> export const useGetUser = (props: UseGetUserProps) => useGet(`/user`, { base: getConfig('code/api/v1'), ...props }) export type UpdateUserProps = Omit, 'path' | 'verb'> export const UpdateUser = (props: UpdateUserProps) => ( verb="PATCH" path={`/user`} base={getConfig('code/api/v1')} {...props} /> ) export type UseUpdateUserProps = Omit< UseMutateProps, 'path' | 'verb' > export const useUpdateUser = (props: UseUpdateUserProps) => useMutate('PATCH', `/user`, { base: getConfig('code/api/v1'), ...props }) export interface MembershipSpacesQueryParams { /** * The substring by which the spaces the users is a member of are filtered. */ query?: string /** * The order of the output. */ order?: 'asc' | 'desc' /** * The field by which the spaces the user is a member of are sorted. */ sort?: 'created' | 'path' | 'uid' /** * The page to return. */ page?: number /** * The maximum number of results to return. */ limit?: number } export type MembershipSpacesProps = Omit< GetProps, 'path' > export const MembershipSpaces = (props: MembershipSpacesProps) => ( path={`/user/memberships`} base={getConfig('code/api/v1')} {...props} /> ) export type UseMembershipSpacesProps = Omit< UseGetProps, 'path' > export const useMembershipSpaces = (props: UseMembershipSpacesProps) => useGet(`/user/memberships`, { base: getConfig('code/api/v1'), ...props }) export type CreateTokenProps = Omit< MutateProps, 'path' | 'verb' > export const CreateToken = (props: CreateTokenProps) => ( verb="POST" path={`/user/token`} base={getConfig('code/api/v1')} {...props} /> ) export type UseCreateTokenProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateToken = (props: UseCreateTokenProps) => useMutate('POST', `/user/token`, { base: getConfig('code/api/v1'), ...props })