Skip to content

Commit

Permalink
chore: 🐝 Update SDK - Generate (#25)
Browse files Browse the repository at this point in the history
* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.112.1

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.114.1

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.115.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.116.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.118.3

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.120.1

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.120.3

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.120.4

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.121.1

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.121.3

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.122.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.122.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.122.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.123.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.124.1

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.126.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.126.4

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.127.0

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.130.1

* ci: regenerated with OpenAPI Doc v2, Speakeasy CLI 1.134.0

---------

Co-authored-by: speakeasybot <[email protected]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Jan 9, 2024
1 parent 99309b2 commit 15af167
Show file tree
Hide file tree
Showing 1,051 changed files with 11,110 additions and 11,003 deletions.
Empty file modified .eslintrc.yml
100755 → 100644
Empty file.
Empty file modified .gitattributes
100755 → 100644
Empty file.
625 changes: 625 additions & 0 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

305 changes: 244 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The CircleCI API Node SDK is a NPM library for accessing the resources that make up the [CircleCI API V2](https://circleci.com/docs/api/v2/index.html).

<!-- Start SDK Installation -->
<!-- Start SDK Installation [installation] -->
## SDK Installation

### NPM
Expand All @@ -16,37 +16,44 @@ npm add circleci-v2-sdk
```bash
yarn add circleci-v2-sdk
```
<!-- End SDK Installation -->
<!-- End SDK Installation [installation] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

<!-- Start SDK Example Usage -->
```typescript
import { Circleci } from "circleci-v2-sdk";
import { AddEnvironmentVariableToContextResponse } from "circleci-v2-sdk/dist/sdk/models/operations";

const sdk = new Circleci({
security: {
apiKeyHeader: "",
},
});

sdk.context.addEnvironmentVariableToContext({
requestBody: {
value: "some-secret-value",
},
contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
envVarName: "Pants reproachfully",
}).then((res: AddEnvironmentVariableToContextResponse) => {
if (res.statusCode == 200) {
// handle response
}
});

async function run() {
const sdk = new Circleci({
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});

const res = await sdk.context.addEnvironmentVariableToContext({
requestBody: {
value: "some-secret-value",
},
contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
envVarName: "string",
});

if (res.statusCode == 200) {
// handle response
}
}

run();

```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->

<!-- Start SDK Available Operations -->
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations


### [context](docs/sdks/context/README.md)

* [addEnvironmentVariableToContext](docs/sdks/context/README.md#addenvironmentvariabletocontext) - Add or update an environment variable
Expand All @@ -70,12 +77,11 @@ sdk.context.addEnvironmentVariableToContext({
* [getProjectWorkflowsPageData](docs/sdks/insights/README.md#getprojectworkflowspagedata) - Get summary metrics and trends for a project across it's workflows and branches
* [getWorkflowSummary](docs/sdks/insights/README.md#getworkflowsummary) - Get metrics and trends for workflows

### [job](docs/sdks/job/README.md)
### [user](docs/sdks/user/README.md)

* [cancelJob](docs/sdks/job/README.md#canceljob) - Cancel job
* [getJobArtifacts](docs/sdks/job/README.md#getjobartifacts) - Get a job's artifacts
* [getJobDetails](docs/sdks/job/README.md#getjobdetails) - Get job details
* [getTests](docs/sdks/job/README.md#gettests) - Get test metadata
* [getCollaborations](docs/sdks/user/README.md#getcollaborations) - Collaborations
* [getCurrentUser](docs/sdks/user/README.md#getcurrentuser) - User Information
* [getUser](docs/sdks/user/README.md#getuser) - User Information

### [oidcTokenManagement](docs/sdks/oidctokenmanagement/README.md)

Expand All @@ -86,18 +92,6 @@ sdk.context.addEnvironmentVariableToContext({
* [patchOrgClaims](docs/sdks/oidctokenmanagement/README.md#patchorgclaims) - Patch org-level claims
* [patchProjectClaims](docs/sdks/oidctokenmanagement/README.md#patchprojectclaims) - Patch project-level claims

### [pipeline](docs/sdks/pipeline/README.md)

* [continuePipeline](docs/sdks/pipeline/README.md#continuepipeline) - Continue a pipeline
* [getPipelineById](docs/sdks/pipeline/README.md#getpipelinebyid) - Get a pipeline by ID
* [getPipelineByNumber](docs/sdks/pipeline/README.md#getpipelinebynumber) - Get a pipeline by pipeline number
* [getPipelineConfigById](docs/sdks/pipeline/README.md#getpipelineconfigbyid) - Get a pipeline's configuration
* [listMyPipelines](docs/sdks/pipeline/README.md#listmypipelines) - Get your pipelines
* [listPipelines](docs/sdks/pipeline/README.md#listpipelines) - Get a list of pipelines
* [listPipelinesForProject](docs/sdks/pipeline/README.md#listpipelinesforproject) - Get all pipelines
* [listWorkflowsByPipelineId](docs/sdks/pipeline/README.md#listworkflowsbypipelineid) - Get a pipeline's workflows
* [triggerPipeline](docs/sdks/pipeline/README.md#triggerpipeline) - Trigger a new pipeline

### [policyManagement](docs/sdks/policymanagement/README.md)

* [createPolicyBundle](docs/sdks/policymanagement/README.md#createpolicybundle) - Creates policy bundle for the context
Expand All @@ -110,6 +104,18 @@ sdk.context.addEnvironmentVariableToContext({
* [makeDecision](docs/sdks/policymanagement/README.md#makedecision) - Makes a decision
* [setDecisionSettings](docs/sdks/policymanagement/README.md#setdecisionsettings) - Set the decision settings

### [pipeline](docs/sdks/pipeline/README.md)

* [continuePipeline](docs/sdks/pipeline/README.md#continuepipeline) - Continue a pipeline
* [getPipelineById](docs/sdks/pipeline/README.md#getpipelinebyid) - Get a pipeline by ID
* [getPipelineByNumber](docs/sdks/pipeline/README.md#getpipelinebynumber) - Get a pipeline by pipeline number
* [getPipelineConfigById](docs/sdks/pipeline/README.md#getpipelineconfigbyid) - Get a pipeline's configuration
* [listMyPipelines](docs/sdks/pipeline/README.md#listmypipelines) - Get your pipelines
* [listPipelines](docs/sdks/pipeline/README.md#listpipelines) - Get a list of pipelines
* [listPipelinesForProject](docs/sdks/pipeline/README.md#listpipelinesforproject) - Get all pipelines
* [listWorkflowsByPipelineId](docs/sdks/pipeline/README.md#listworkflowsbypipelineid) - Get a pipeline's workflows
* [triggerPipeline](docs/sdks/pipeline/README.md#triggerpipeline) - Trigger a new pipeline

### [project](docs/sdks/project/README.md)

* [createCheckoutKey](docs/sdks/project/README.md#createcheckoutkey) - Create a new checkout key
Expand All @@ -122,6 +128,13 @@ sdk.context.addEnvironmentVariableToContext({
* [listCheckoutKeys](docs/sdks/project/README.md#listcheckoutkeys) - Get all checkout keys
* [listEnvVars](docs/sdks/project/README.md#listenvvars) - List all environment variables

### [job](docs/sdks/job/README.md)

* [cancelJob](docs/sdks/job/README.md#canceljob) - Cancel job
* [getJobArtifacts](docs/sdks/job/README.md#getjobartifacts) - Get a job's artifacts
* [getJobDetails](docs/sdks/job/README.md#getjobdetails) - Get job details
* [getTests](docs/sdks/job/README.md#gettests) - Get test metadata

### [schedule](docs/sdks/schedule/README.md)

* [createSchedule](docs/sdks/schedule/README.md#createschedule) - Create a schedule
Expand All @@ -130,19 +143,13 @@ sdk.context.addEnvironmentVariableToContext({
* [listSchedulesForProject](docs/sdks/schedule/README.md#listschedulesforproject) - Get all schedules
* [updateSchedule](docs/sdks/schedule/README.md#updateschedule) - Update a schedule

### [user](docs/sdks/user/README.md)

* [getCollaborations](docs/sdks/user/README.md#getcollaborations) - Collaborations
* [getCurrentUser](docs/sdks/user/README.md#getcurrentuser) - User Information
* [getUser](docs/sdks/user/README.md#getuser) - User Information

### [webhook](docs/sdks/webhook/README.md)

* [createWebhook](docs/sdks/webhook/README.md#createwebhook) - Create a webhook
* [deleteWebhook](docs/sdks/webhook/README.md#deletewebhook) - Delete a webhook
* [createWebhook](docs/sdks/webhook/README.md#createwebhook) - Create an outbound webhook
* [deleteWebhook](docs/sdks/webhook/README.md#deletewebhook) - Delete an outbound webhook
* [getWebhookById](docs/sdks/webhook/README.md#getwebhookbyid) - Get a webhook
* [getWebhooks](docs/sdks/webhook/README.md#getwebhooks) - List webhooks
* [updateWebhook](docs/sdks/webhook/README.md#updatewebhook) - Update a webhook
* [updateWebhook](docs/sdks/webhook/README.md#updatewebhook) - Update an outbound webhook

### [workflow](docs/sdks/workflow/README.md)

Expand All @@ -151,25 +158,201 @@ sdk.context.addEnvironmentVariableToContext({
* [getWorkflowById](docs/sdks/workflow/README.md#getworkflowbyid) - Get a workflow
* [listWorkflowJobs](docs/sdks/workflow/README.md#listworkflowjobs) - Get a workflow's jobs
* [rerunWorkflow](docs/sdks/workflow/README.md#rerunworkflow) - Rerun a workflow
<!-- End SDK Available Operations -->
<!-- End Available Resources and Operations [operations] -->



<!-- Start Dev Containers -->

<!-- End Dev Containers -->



<!-- Start Pagination -->
# Pagination
<!-- Start Error Handling [errors] -->
## Error Handling

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a `next` method that can be called to pull down the next group of results. If the
return value of `next` is `null`, then there are no more pages to be fetched.
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.

Here's an example of one such pagination call:
<!-- End Pagination -->
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

Example

```typescript
import { Circleci } from "circleci-v2-sdk";

async function run() {
const sdk = new Circleci({
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});

let res;
try {
res = await sdk.context.addEnvironmentVariableToContext({
requestBody: {
value: "some-secret-value",
},
contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
envVarName: "string",
});
} catch (err) {
if (err instanceof errors.SDKError) {
console.error(err); // handle exception
throw err;
}
}

if (res.statusCode == 200) {
// handle response
}
}

run();

```
<!-- End Error Handling [errors] -->



<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://circleci.com/api/v2` | None |

#### Example

```typescript
import { Circleci } from "circleci-v2-sdk";

async function run() {
const sdk = new Circleci({
serverIdx: 0,
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});

const res = await sdk.context.addEnvironmentVariableToContext({
requestBody: {
value: "some-secret-value",
},
contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
envVarName: "string",
});

if (res.statusCode == 200) {
// handle response
}
}

run();

```


### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
```typescript
import { Circleci } from "circleci-v2-sdk";

async function run() {
const sdk = new Circleci({
serverURL: "https://circleci.com/api/v2",
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});

const res = await sdk.context.addEnvironmentVariableToContext({
requestBody: {
value: "some-secret-value",
},
contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
envVarName: "string",
});

if (res.statusCode == 200) {
// handle response
}
}

run();

```
<!-- End Server Selection [server] -->



<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Typescript SDK makes API calls using the [axios](https://axios-http.com/docs/intro) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.

For example, you could specify a header for every request that your sdk makes as follows:

```typescript
import { circleci-v2-sdk } from "Circleci";
import axios from "axios";

const httpClient = axios.create({
headers: {'x-custom-header': 'someValue'}
})

const sdk = new Circleci({defaultClient: httpClient});
```
<!-- End Custom HTTP Client [http-client] -->



<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security schemes globally:

| Name | Type | Scheme |
| -------------- | -------------- | -------------- |
| `apiKeyHeader` | apiKey | API key |
| `apiKeyQuery` | apiKey | API key |
| `basicAuth` | http | HTTP Basic |

You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
```typescript
import { Circleci } from "circleci-v2-sdk";

async function run() {
const sdk = new Circleci({
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});

const res = await sdk.context.addEnvironmentVariableToContext({
requestBody: {
value: "some-secret-value",
},
contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
envVarName: "string",
});

if (res.statusCode == 200) {
// handle response
}
}

run();

```
<!-- End Authentication [security] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

Expand Down
Loading

0 comments on commit 15af167

Please sign in to comment.