Skip to content

Commit

Permalink
daily update 20240123T000258
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 23, 2024
1 parent aa5c8a3 commit 64f4f8a
Show file tree
Hide file tree
Showing 8 changed files with 1,626 additions and 265 deletions.
4 changes: 4 additions & 0 deletions client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ export type { OpenAPIConfig } from "./core/OpenAPI.ts";
export type { BundleDiff } from "./models/BundleDiff.ts";
export type { BundlePayload } from "./models/BundlePayload.ts";
export type { ClaimResponse } from "./models/ClaimResponse.ts";
export type { context_project_restrictions_list } from "./models/context_project_restrictions_list.ts";
export type { Decision } from "./models/Decision.ts";
export type { DecisionLog } from "./models/DecisionLog.ts";
export type { DecisionSettings } from "./models/DecisionSettings.ts";
export type { JSONDuration } from "./models/JSONDuration.ts";
export type { PatchClaimsRequest } from "./models/PatchClaimsRequest.ts";
export type { Policy } from "./models/Policy.ts";
export type { PolicyBundle } from "./models/PolicyBundle.ts";
export type { project_settings } from "./models/project_settings.ts";
export type { restriction_created } from "./models/restriction_created.ts";
export type { restriction_deleted } from "./models/restriction_deleted.ts";
export type { Violation } from "./models/Violation.ts";
export { ContextService } from "./services/ContextService.ts";
export { InsightsService } from "./services/InsightsService.ts";
Expand Down
10 changes: 10 additions & 0 deletions client/models/context_project_restrictions_list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type context_project_restrictions_list = {
items?: Array<any>;
/**
* Token that can be used to retrieve next page of results
*/
next_page_token?: string | null;
};
47 changes: 47 additions & 0 deletions client/models/project_settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type project_settings = {
advanced?: {
/**
* Except for the default branch, cancel running pipelines on a branch when a new pipeline starts on that branch.
*/
autocancel_builds?: boolean;
/**
* Run builds for pull requests from forks.
*/
build_fork_prs?: boolean;
/**
* Once enabled, we will only build branches that have associated pull requests open.
*/
build_prs_only?: boolean;
/**
* When set to true, job re-runs with SSH debugging access will be disabled for the project.
*/
disable_ssh?: boolean;
/**
* Run builds for forked pull requests with this project's configuration, environment variables, and secrets.
*/
forks_receive_secret_env_vars?: boolean;
/**
* Free and Open Source. Enabling this grants additional credits, and lets others see your builds, both through the web UI and the API.
*/
oss?: boolean;
/**
* This field is used in conjunction with the `build_prs_only`, it allows you to specify a list of branches that will always triger a build. The value passed will overwrite the existing value.
*/
pr_only_branch_overrides?: Array<string>;
/**
* Report the status of every pushed commit to GitHub's status API. Updates reported per job.
*/
set_github_status?: boolean;
/**
* Enabling allows you to conditionally trigger configurations outside of the primary `.circleci` parent directory.
*/
setup_workflows?: boolean;
/**
* Whether updating these settings requires a user to be an organization administrator. When disabled, updating settings can be done by any member.
*/
write_settings_requires_admin?: boolean;
};
};
4 changes: 4 additions & 0 deletions client/models/restriction_created.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type restriction_created = {};
4 changes: 4 additions & 0 deletions client/models/restriction_deleted.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type restriction_deleted = {};
103 changes: 103 additions & 0 deletions client/services/ContextService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,110 @@
import type { context_project_restrictions_list } from "../models/context_project_restrictions_list.ts";
import type { restriction_created } from "../models/restriction_created.ts";
import type { restriction_deleted } from "../models/restriction_deleted.ts";
import type { CancelablePromise } from "../core/CancelablePromise.ts";
import { OpenAPI } from "../core/OpenAPI.ts";
import { request as __request } from "../core/request.ts";
export class ContextService {
/**
* 🧪 Get context restrictions
* [__EXPERIMENTAL__] Gets a list of project restrictions associated with a context.
* @returns context_project_restrictions_list Successful response.
* @throws ApiError
*/
public static getContextRestrictions({
contextId,
}: {
/**
* An opaque identifier of a context.
*/
contextId: string;
}): CancelablePromise<context_project_restrictions_list> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v2/context/{context_id}/restrictions",
path: {
context_id: contextId,
},
errors: {
400: `Context ID provided is invalid.`,
401: `Credentials provided are invalid.`,
404: `Entity not found.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* 🧪 Create context restriction
* [__EXPERIMENTAL__] Creates project restriction on a context.
* @returns restriction_created Successful response.
* @throws ApiError
*/
public static createContextRestriction({
contextId,
requestBody,
}: {
/**
* An opaque identifier of a context.
*/
contextId: string;
requestBody: {
project_id?: string;
};
}): CancelablePromise<restriction_created> {
return __request(OpenAPI, {
method: "POST",
url: "/api/v2/context/{context_id}/restrictions",
path: {
context_id: contextId,
},
body: requestBody,
mediaType: "application/json",
errors: {
400: `Bad request.`,
401: `Credentials provided are invalid.`,
404: `Entity not found.`,
409: `Request conflict.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* 🧪 Delete context restriction
* [__EXPERIMENTAL__] Deletes a project restriction on a context.
* @returns restriction_deleted Successful response.
* @throws ApiError
*/
public static deleteContextRestriction({
contextId,
restrictionId,
}: {
/**
* An opaque identifier of a context.
*/
contextId: string;
/**
* An opaque identifier of a context restriction.
*/
restrictionId: string;
}): CancelablePromise<restriction_deleted> {
return __request(OpenAPI, {
method: "DELETE",
url: "/api/v2/context/{context_id}/restrictions/{restriction_id}",
path: {
context_id: contextId,
restriction_id: restrictionId,
},
errors: {
400: `Context restriction ID provided is invalid.`,
401: `Credentials provided are invalid.`,
404: `Entity not found.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* List contexts
* List all contexts for an owner.
Expand Down
135 changes: 135 additions & 0 deletions client/services/ProjectService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,142 @@
import type { project_settings } from "../models/project_settings.ts";
import type { CancelablePromise } from "../core/CancelablePromise.ts";
import { OpenAPI } from "../core/OpenAPI.ts";
import { request as __request } from "../core/request.ts";
export class ProjectService {
/**
* 🧪 Create a project
* [__EXPERIMENTAL__] Creates a new CircleCI project, and returns a list of the default advanced settings. Can only be called on a repo with a main branch and an existing config.yml file. Not yet available to projects that use GitLab or GitHub App.
* @returns project_settings Successful response.
* @throws ApiError
*/
public static createProject({
provider,
organization,
project,
}: {
/**
* The `provider` segment of a project or org slug, the first of the three. This may be a VCS. For projects that use GitLab or GitHub App, use `circleci`.
*/
provider: string;
/**
* The `organization` segment of a project or org slug, the second of the three. For GitHub OAuth or Bitbucket projects, this is the organization name. For projects that use GitLab or GitHub App, use the organization ID (found in Organization Settings).
*/
organization: string;
/**
* The `project` segment of a project slug, the third of the three. For GitHub OAuth or Bitbucket projects, this is the repository name. For projects that use GitLab or GitHub App, use the project ID (found in Project Settings).
*/
project: string;
}): CancelablePromise<project_settings> {
return __request(OpenAPI, {
method: "POST",
url: "/api/v2/project/{provider}/{organization}/{project}",
path: {
provider: provider,
organization: organization,
project: project,
},
errors: {
400: `Unexpected request body provided.`,
401: `Credentials provided are invalid.`,
403: `None or insufficient credentials provided.`,
404: `Either a branch or a project were not found.`,
405: `Create projects using the API is currently supported for classic Github OAuth and Bitbucket projects only.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* 🧪 Get project settings
* [__EXPERIMENTAL__] Returns a list of the advanced settings for a CircleCI project, whether enabled (true) or not (false).
* @returns project_settings Successful response.
* @throws ApiError
*/
public static getProjectSettings({
provider,
organization,
project,
}: {
/**
* The `provider` segment of a project or org slug, the first of the three. This may be a VCS. For projects that use GitLab or GitHub App, use `circleci`.
*/
provider: string;
/**
* The `organization` segment of a project or org slug, the second of the three. For GitHub OAuth or Bitbucket projects, this is the organization name. For projects that use GitLab or GitHub App, use the organization ID (found in Organization Settings).
*/
organization: string;
/**
* The `project` segment of a project slug, the third of the three. For GitHub OAuth or Bitbucket projects, this is the repository name. For projects that use GitLab or GitHub App, use the project ID (found in Project Settings).
*/
project: string;
}): CancelablePromise<project_settings> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v2/project/{provider}/{organization}/{project}/settings",
path: {
provider: provider,
organization: organization,
project: project,
},
errors: {
401: `Credentials provided are invalid.`,
403: `None or insufficient credentials provided.`,
404: `Insufficient credentials for a private project, OR the organization, project, or repository does not exist.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* 🧪 Update project settings
* [__EXPERIMENTAL__] Updates one or more of the advanced settings for a CircleCI project.
* @returns project_settings Successful response. Always includes the full advanced settings object. Returned even when the provided updates match the existing settings, but can also be returned when `oss: true` fails to set.
* @throws ApiError
*/
public static patchProjectSettings({
provider,
organization,
project,
requestBody,
}: {
/**
* The `provider` segment of a project or org slug, the first of the three. This may be a VCS. For projects that use GitLab or GitHub App, use `circleci`.
*/
provider: string;
/**
* The `organization` segment of a project or org slug, the second of the three. For GitHub OAuth or Bitbucket projects, this is the organization name. For projects that use GitLab or GitHub App, use the organization ID (found in Organization Settings).
*/
organization: string;
/**
* The `project` segment of a project slug, the third of the three. For GitHub OAuth or Bitbucket projects, this is the repository name. For projects that use GitLab or GitHub App, use the project ID (found in Project Settings).
*/
project: string;
/**
* The setting(s) to update, including one or more fields in the JSON object. Note that `oss: true` will only be set on projects whose underlying repositories are actually open source.
*/
requestBody: project_settings;
}): CancelablePromise<project_settings> {
return __request(OpenAPI, {
method: "PATCH",
url: "/api/v2/project/{provider}/{organization}/{project}/settings",
path: {
provider: provider,
organization: organization,
project: project,
},
body: requestBody,
mediaType: "application/json",
errors: {
400: `Request is malformed, e.g. with improperly encoded JSON`,
401: `Credentials provided are invalid.`,
403: `None or insufficient credentials provided.`,
404: `Insufficient credentials for a private project, OR the organization, project, or repository does not exist.`,
422: `One or more settings provided do not exist.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* Get a project
* Retrieves a project by project slug.
Expand Down
Loading

0 comments on commit 64f4f8a

Please sign in to comment.