From 5efc36e5c15d3995c46486677ccce680a5c95602 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 17 Aug 2024 16:54:27 +0100 Subject: [PATCH] fix(fetch/axios): correctly merge headers from opts (#231) - Previously if you passed any request headers using the `opts` parameter, this would overwrite the headers set from parameters, defaults, etc - Now these will be consistently merged following: `defaults` -> `params` -> `opts` - `undefined` header values will be ignored, `null` header values will delete headers set previously This wound up being a lot more complex than I'd expected, and there may still be some edges that I've missed. However I'm confident that this makes things better than before based on the new e2e tests at least. --- e2e/openapi.yaml | 40 + e2e/scripts/generate.sh | 12 +- e2e/src/generated/client/axios/client.ts | 88 + e2e/src/generated/client/axios/models.ts | 24 + e2e/src/generated/client/client.ts | 38 - e2e/src/generated/client/fetch/client.ts | 79 + e2e/src/generated/client/fetch/models.ts | 24 + e2e/src/generated/client/models.ts | 12 - e2e/src/generated/models.ts | 16 + e2e/src/generated/routes/headers.ts | 137 + e2e/src/generated/schemas.ts | 8 + e2e/src/index.axios.spec.ts | 164 + e2e/src/index.fetch.spec.ts | 205 + e2e/src/index.spec.ts | 67 - e2e/src/index.ts | 3 + e2e/src/routes/headers.ts | 12 + .../generated/api.github.com.yaml/client.ts | 6974 +++++++++------ .../client.ts | 407 +- .../azure-resource-manager.tsp/client.ts | 63 +- .../src/generated/okta.idp.yaml/client.ts | 258 +- .../src/generated/okta.oauth.yaml/client.ts | 377 +- .../petstore-expanded.yaml/client.ts | 29 +- .../src/generated/stripe.yaml/client.ts | 7096 ++++++++------- .../src/generated/todo-lists.yaml/client.ts | 46 +- .../generated/api.github.com.yaml/client.ts | 7576 ++++++++++------- .../client.ts | 385 +- .../azure-resource-manager.tsp/client.ts | 68 +- .../src/generated/okta.idp.yaml/client.ts | 266 +- .../src/generated/okta.oauth.yaml/client.ts | 448 +- .../petstore-expanded.yaml/client.ts | 32 +- .../src/generated/stripe.yaml/client.ts | 7278 ++++++++-------- .../src/generated/todo-lists.yaml/client.ts | 50 +- .../typescript-axios-client-builder.ts | 15 +- .../typescript-fetch-client-builder.ts | 11 +- .../typescript-axios-runtime/src/main.spec.ts | 172 +- packages/typescript-axios-runtime/src/main.ts | 93 +- .../typescript-fetch-runtime/src/main.spec.ts | 244 +- packages/typescript-fetch-runtime/src/main.ts | 140 +- 38 files changed, 19283 insertions(+), 13674 deletions(-) create mode 100644 e2e/src/generated/client/axios/client.ts create mode 100644 e2e/src/generated/client/axios/models.ts delete mode 100644 e2e/src/generated/client/client.ts create mode 100644 e2e/src/generated/client/fetch/client.ts create mode 100644 e2e/src/generated/client/fetch/models.ts delete mode 100644 e2e/src/generated/client/models.ts create mode 100644 e2e/src/generated/routes/headers.ts create mode 100644 e2e/src/index.axios.spec.ts create mode 100644 e2e/src/index.fetch.spec.ts delete mode 100644 e2e/src/index.spec.ts create mode 100644 e2e/src/routes/headers.ts diff --git a/e2e/openapi.yaml b/e2e/openapi.yaml index 4124ed05..29a1efc9 100644 --- a/e2e/openapi.yaml +++ b/e2e/openapi.yaml @@ -3,8 +3,32 @@ info: title: E2E Tests for @nahkies/openapi-code-generator version: "0.0.1" tags: + - name: headers - name: validation paths: + /headers/undeclared: + get: + tags: + - headers + responses: + 200: + $ref: '#/components/responses/GetHeaders' + /headers/request: + get: + tags: + - headers + parameters: + - name: route-level-header + in: header + schema: + type: string + - name: Authorization + in: header + schema: + type: string + responses: + 200: + $ref: '#/components/responses/GetHeaders' /validation/numbers/random-number: get: tags: @@ -38,6 +62,22 @@ paths: $ref: '#/components/schemas/RandomNumber' components: + responses: + GetHeaders: + description: success + content: + application/json: + schema: + type: object + properties: + headers: + additionalProperties: + anyOf: + - type: string + - type: array + items: + type: string + schemas: RandomNumber: type: object diff --git a/e2e/scripts/generate.sh b/e2e/scripts/generate.sh index 6012d3b7..fc28a0f8 100755 --- a/e2e/scripts/generate.sh +++ b/e2e/scripts/generate.sh @@ -12,8 +12,14 @@ yarn openapi-code-generator \ yarn openapi-code-generator \ --input ./openapi.yaml \ - --output ./src/generated/client \ + --output ./src/generated/client/fetch \ --template typescript-fetch \ --schema-builder zod \ - --extract-inline-schemas \ - --grouping-strategy first-tag \ + --extract-inline-schemas + +yarn openapi-code-generator \ + --input ./openapi.yaml \ + --output ./src/generated/client/axios \ + --template typescript-axios \ + --schema-builder zod \ + --extract-inline-schemas diff --git a/e2e/src/generated/client/axios/client.ts b/e2e/src/generated/client/axios/client.ts new file mode 100644 index 00000000..7c05fcb5 --- /dev/null +++ b/e2e/src/generated/client/axios/client.ts @@ -0,0 +1,88 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { + t_RandomNumber, + t_getHeadersRequestJson200Response, + t_getHeadersUndeclaredJson200Response, +} from "./models" +import { + AbstractAxiosClient, + AbstractAxiosConfig, +} from "@nahkies/typescript-axios-runtime/main" +import { AxiosRequestConfig, AxiosResponse } from "axios" + +export class ApiClient extends AbstractAxiosClient { + constructor(config: AbstractAxiosConfig) { + super(config) + } + + async getHeadersUndeclared( + timeout?: number, + opts: AxiosRequestConfig = {}, + ): Promise> { + const url = `/headers/undeclared` + const headers = this._headers({}, opts.headers) + + return this._request({ + url: url, + method: "GET", + ...(timeout ? { timeout } : {}), + ...opts, + headers, + }) + } + + async getHeadersRequest( + p: { + routeLevelHeader?: string + authorization?: string + } = {}, + timeout?: number, + opts: AxiosRequestConfig = {}, + ): Promise> { + const url = `/headers/request` + const headers = this._headers( + { + "route-level-header": p["routeLevelHeader"], + Authorization: p["authorization"], + }, + opts.headers, + ) + + return this._request({ + url: url, + method: "GET", + ...(timeout ? { timeout } : {}), + ...opts, + headers, + }) + } + + async getValidationNumbersRandomNumber( + p: { + max?: number + min?: number + forbidden?: number[] + } = {}, + timeout?: number, + opts: AxiosRequestConfig = {}, + ): Promise> { + const url = `/validation/numbers/random-number` + const headers = this._headers({}, opts.headers) + const query = this._query({ + max: p["max"], + min: p["min"], + forbidden: p["forbidden"], + }) + + return this._request({ + url: url + query, + method: "GET", + ...(timeout ? { timeout } : {}), + ...opts, + headers, + }) + } +} diff --git a/e2e/src/generated/client/axios/models.ts b/e2e/src/generated/client/axios/models.ts new file mode 100644 index 00000000..6d294ba9 --- /dev/null +++ b/e2e/src/generated/client/axios/models.ts @@ -0,0 +1,24 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +export type t_RandomNumber = { + params?: { + forbidden?: number[] + max?: number + min?: number + } + result?: number +} + +export type t_getHeadersRequestJson200Response = { + headers?: { + [key: string]: (string | string[]) | undefined + } +} + +export type t_getHeadersUndeclaredJson200Response = { + headers?: { + [key: string]: (string | string[]) | undefined + } +} diff --git a/e2e/src/generated/client/client.ts b/e2e/src/generated/client/client.ts deleted file mode 100644 index 0466e259..00000000 --- a/e2e/src/generated/client/client.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** AUTOGENERATED - DO NOT EDIT **/ -/* tslint:disable */ -/* eslint-disable */ - -import { t_RandomNumber } from "./models" -import { - AbstractFetchClient, - AbstractFetchClientConfig, - Res, - TypedFetchResponse, -} from "@nahkies/typescript-fetch-runtime/main" - -export interface ApiClientConfig extends AbstractFetchClientConfig {} - -export class ApiClient extends AbstractFetchClient { - constructor(config: ApiClientConfig) { - super(config) - } - - async getValidationNumbersRandomNumber( - p: { - max?: number - min?: number - forbidden?: number[] - } = {}, - timeout?: number, - opts?: RequestInit, - ): Promise>> { - const url = this.basePath + `/validation/numbers/random-number` - const query = this._query({ - max: p["max"], - min: p["min"], - forbidden: p["forbidden"], - }) - - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) - } -} diff --git a/e2e/src/generated/client/fetch/client.ts b/e2e/src/generated/client/fetch/client.ts new file mode 100644 index 00000000..8422577f --- /dev/null +++ b/e2e/src/generated/client/fetch/client.ts @@ -0,0 +1,79 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { + t_RandomNumber, + t_getHeadersRequestJson200Response, + t_getHeadersUndeclaredJson200Response, +} from "./models" +import { + AbstractFetchClient, + AbstractFetchClientConfig, + Res, + TypedFetchResponse, +} from "@nahkies/typescript-fetch-runtime/main" + +export interface ApiClientConfig extends AbstractFetchClientConfig {} + +export class ApiClient extends AbstractFetchClient { + constructor(config: ApiClientConfig) { + super(config) + } + + async getHeadersUndeclared( + timeout?: number, + opts: RequestInit = {}, + ): Promise< + TypedFetchResponse> + > { + const url = this.basePath + `/headers/undeclared` + const headers = this._headers({}, opts.headers) + + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + } + + async getHeadersRequest( + p: { + routeLevelHeader?: string + authorization?: string + } = {}, + timeout?: number, + opts: RequestInit = {}, + ): Promise>> { + const url = this.basePath + `/headers/request` + const headers = this._headers( + { + "route-level-header": p["routeLevelHeader"], + Authorization: p["authorization"], + }, + opts.headers, + ) + + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) + } + + async getValidationNumbersRandomNumber( + p: { + max?: number + min?: number + forbidden?: number[] + } = {}, + timeout?: number, + opts: RequestInit = {}, + ): Promise>> { + const url = this.basePath + `/validation/numbers/random-number` + const headers = this._headers({}, opts.headers) + const query = this._query({ + max: p["max"], + min: p["min"], + forbidden: p["forbidden"], + }) + + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) + } +} diff --git a/e2e/src/generated/client/fetch/models.ts b/e2e/src/generated/client/fetch/models.ts new file mode 100644 index 00000000..6d294ba9 --- /dev/null +++ b/e2e/src/generated/client/fetch/models.ts @@ -0,0 +1,24 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +export type t_RandomNumber = { + params?: { + forbidden?: number[] + max?: number + min?: number + } + result?: number +} + +export type t_getHeadersRequestJson200Response = { + headers?: { + [key: string]: (string | string[]) | undefined + } +} + +export type t_getHeadersUndeclaredJson200Response = { + headers?: { + [key: string]: (string | string[]) | undefined + } +} diff --git a/e2e/src/generated/client/models.ts b/e2e/src/generated/client/models.ts deleted file mode 100644 index 26bbd22e..00000000 --- a/e2e/src/generated/client/models.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** AUTOGENERATED - DO NOT EDIT **/ -/* tslint:disable */ -/* eslint-disable */ - -export type t_RandomNumber = { - params?: { - forbidden?: number[] - max?: number - min?: number - } - result?: number -} diff --git a/e2e/src/generated/models.ts b/e2e/src/generated/models.ts index 9c136663..5054a9ae 100644 --- a/e2e/src/generated/models.ts +++ b/e2e/src/generated/models.ts @@ -13,6 +13,22 @@ export type t_RandomNumber = { result?: number | undefined } +export type t_getHeadersRequestJson200Response = { + headers?: + | { + [key: string]: (string | string[]) | undefined + } + | undefined +} + +export type t_getHeadersUndeclaredJson200Response = { + headers?: + | { + [key: string]: (string | string[]) | undefined + } + | undefined +} + export type t_GetValidationNumbersRandomNumberQuerySchema = { forbidden?: number[] | undefined max?: number | undefined diff --git a/e2e/src/generated/routes/headers.ts b/e2e/src/generated/routes/headers.ts new file mode 100644 index 00000000..a86879ec --- /dev/null +++ b/e2e/src/generated/routes/headers.ts @@ -0,0 +1,137 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint-disable */ + +import { + t_getHeadersRequestJson200Response, + t_getHeadersUndeclaredJson200Response, +} from "../models" +import { + s_getHeadersRequestJson200Response, + s_getHeadersUndeclaredJson200Response, +} from "../schemas" +import KoaRouter, { RouterContext } from "@koa/router" +import { KoaRuntimeError } from "@nahkies/typescript-koa-runtime/errors" +import { + KoaRuntimeResponder, + KoaRuntimeResponse, + Response, + StatusCode, +} from "@nahkies/typescript-koa-runtime/server" +import { + Params, + responseValidationFactory, +} from "@nahkies/typescript-koa-runtime/zod" + +export type GetHeadersUndeclaredResponder = { + with200(): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type GetHeadersUndeclared = ( + params: Params, + respond: GetHeadersUndeclaredResponder, + ctx: RouterContext, +) => Promise< + | KoaRuntimeResponse + | Response<200, t_getHeadersUndeclaredJson200Response> +> + +export type GetHeadersRequestResponder = { + with200(): KoaRuntimeResponse +} & KoaRuntimeResponder + +export type GetHeadersRequest = ( + params: Params, + respond: GetHeadersRequestResponder, + ctx: RouterContext, +) => Promise< + | KoaRuntimeResponse + | Response<200, t_getHeadersRequestJson200Response> +> + +export type Implementation = { + getHeadersUndeclared: GetHeadersUndeclared + getHeadersRequest: GetHeadersRequest +} + +export function createRouter(implementation: Implementation): KoaRouter { + const router = new KoaRouter() + + const getHeadersUndeclaredResponseValidator = responseValidationFactory( + [["200", s_getHeadersUndeclaredJson200Response]], + undefined, + ) + + router.get( + "getHeadersUndeclared", + "/headers/undeclared", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse( + 200, + ) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const response = await implementation + .getHeadersUndeclared(input, responder, ctx) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + const { status, body } = + response instanceof KoaRuntimeResponse ? response.unpack() : response + + ctx.body = getHeadersUndeclaredResponseValidator(status, body) + ctx.status = status + return next() + }, + ) + + const getHeadersRequestResponseValidator = responseValidationFactory( + [["200", s_getHeadersRequestJson200Response]], + undefined, + ) + + router.get("getHeadersRequest", "/headers/request", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const responder = { + with200() { + return new KoaRuntimeResponse(200) + }, + withStatus(status: StatusCode) { + return new KoaRuntimeResponse(status) + }, + } + + const response = await implementation + .getHeadersRequest(input, responder, ctx) + .catch((err) => { + throw KoaRuntimeError.HandlerError(err) + }) + + const { status, body } = + response instanceof KoaRuntimeResponse ? response.unpack() : response + + ctx.body = getHeadersRequestResponseValidator(status, body) + ctx.status = status + return next() + }) + + return router +} diff --git a/e2e/src/generated/schemas.ts b/e2e/src/generated/schemas.ts index e03818ec..49c9259d 100644 --- a/e2e/src/generated/schemas.ts +++ b/e2e/src/generated/schemas.ts @@ -14,3 +14,11 @@ export const s_RandomNumber = z.object({ }) .optional(), }) + +export const s_getHeadersUndeclaredJson200Response = z.object({ + headers: z.record(z.union([z.string(), z.array(z.string())])).optional(), +}) + +export const s_getHeadersRequestJson200Response = z.object({ + headers: z.record(z.union([z.string(), z.array(z.string())])).optional(), +}) diff --git a/e2e/src/index.axios.spec.ts b/e2e/src/index.axios.spec.ts new file mode 100644 index 00000000..82bfba48 --- /dev/null +++ b/e2e/src/index.axios.spec.ts @@ -0,0 +1,164 @@ +import type {Server} from "node:http" +import {beforeAll, describe, expect, it} from "@jest/globals" +import {ApiClient} from "./generated/client/axios/client" +import {main} from "./index" +import {numberBetween} from "./test-utils" + +describe("e2e - typescript-axios client", () => { + let server: Server + let client: ApiClient + + beforeAll(async () => { + const args = await main() + client = new ApiClient({ + basePath: `http://localhost:${args.address.port}`, + defaultHeaders: { + Authorization: "Bearer default-header", + }, + }) + server = args.server + }) + + afterAll(async () => { + server.close() + }) + + describe("GET /headers/undeclared", () => { + it("provides the default headers", async () => { + const {data} = await client.getHeadersUndeclared() + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + }), + }) + }) + + it("provides default headers, and arbitrary extra headers", async () => { + const {data} = await client.getHeadersUndeclared(undefined, { + headers: {"some-random-header": "arbitrary-header"}, + }) + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + "some-random-header": "arbitrary-header", + }), + }) + }) + }) + + describe("GET /headers/request", () => { + it("provides the default headers", async () => { + const {data} = await client.getHeadersRequest() + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + }), + }) + }) + + it("provides route level header with default headers", async () => { + const {data} = await client.getHeadersRequest({ + routeLevelHeader: "route-header", + }) + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + "route-level-header": "route-header", + }), + }) + }) + + it("overrides the default headers when a route level header is provided", async () => { + const {data} = await client.getHeadersRequest({ + authorization: "Bearer override", + }) + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer override", + }), + }) + }) + + it("overrides the default headers when a config level header is provided", async () => { + const {data} = await client.getHeadersRequest(undefined, undefined, { + headers: {authorization: "Bearer config"}, + }) + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer config", + }), + }) + }) + it("provides route level header with default headers, and arbitrary extra headers", async () => { + const {data} = await client.getHeadersRequest( + {routeLevelHeader: "route-header"}, + undefined, + {headers: {"some-random-header": "arbitrary-header"}}, + ) + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + "route-level-header": "route-header", + "some-random-header": "arbitrary-header", + }), + }) + }) + + it("provides route level header with default headers, and arbitrary extra headers", async () => { + const {data} = await client.getHeadersRequest( + {routeLevelHeader: "route-header"}, + undefined, + {headers: {authorization: "Bearer override"}}, + ) + + expect(data).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer override", + "route-level-header": "route-header", + }), + }) + }) + }) + + describe("GET /validation/numbers/random-number", () => { + it("returns a random number", async () => { + const {data} = await client.getValidationNumbersRandomNumber() + + expect(data).toEqual({ + result: numberBetween(0, 10), + params: { + min: 0, + max: 10, + forbidden: [], + }, + }) + }) + + it("handles a query param array of 1 element", async () => { + const {data} = await client.getValidationNumbersRandomNumber({ + forbidden: [1], + }) + + expect(data.params).toMatchObject({ + forbidden: [1], + }) + }) + + it("handles a query param array of multiple elements", async () => { + const {data} = await client.getValidationNumbersRandomNumber({ + forbidden: [1, 2, 3], + }) + + expect(data.params).toMatchObject({ + forbidden: [1, 2, 3], + }) + }) + }) +}) diff --git a/e2e/src/index.fetch.spec.ts b/e2e/src/index.fetch.spec.ts new file mode 100644 index 00000000..b41b8c10 --- /dev/null +++ b/e2e/src/index.fetch.spec.ts @@ -0,0 +1,205 @@ +import type {Server} from "node:http" +import {beforeAll, describe, expect, it} from "@jest/globals" +import {ApiClient} from "./generated/client/fetch/client" +import {main} from "./index" +import {numberBetween} from "./test-utils" + +describe("e2e - typescript-fetch client", () => { + let server: Server + let client: ApiClient + + beforeAll(async () => { + const args = await main() + client = new ApiClient({ + basePath: `http://localhost:${args.address.port}`, + defaultHeaders: { + Authorization: "Bearer default-header", + }, + }) + server = args.server + }) + + afterAll(async () => { + server.close() + }) + + describe("GET /headers/undeclared", () => { + it("provides the default headers", async () => { + const res = await client.getHeadersUndeclared() + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + }), + }) + }) + it("provides default headers, and arbitrary extra headers", async () => { + const res = await client.getHeadersUndeclared(undefined, { + headers: {"some-random-header": "arbitrary-header"}, + }) + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + "some-random-header": "arbitrary-header", + }), + }) + }) + }) + + describe("GET /headers/request", () => { + it("provides the default headers", async () => { + const res = await client.getHeadersRequest() + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + }), + }) + }) + + it("provides route level header with default headers", async () => { + const res = await client.getHeadersRequest({ + routeLevelHeader: "route-header", + }) + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + "route-level-header": "route-header", + }), + }) + }) + + it("overrides the default headers when a route level header is provided", async () => { + const res = await client.getHeadersRequest({ + authorization: "Bearer override", + }) + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer override", + }), + }) + }) + + it("overrides the default headers when a config level header is provided", async () => { + const res = await client.getHeadersRequest(undefined, undefined, { + headers: {authorization: "Bearer config"}, + }) + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer config", + }), + }) + }) + + it("provides route level header with default headers, and arbitrary extra headers", async () => { + const res = await client.getHeadersRequest( + {routeLevelHeader: "route-header"}, + undefined, + {headers: {"some-random-header": "arbitrary-header"}}, + ) + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer default-header", + "route-level-header": "route-header", + "some-random-header": "arbitrary-header", + }), + }) + }) + + it("provides route level header with default headers, and arbitrary extra headers", async () => { + const res = await client.getHeadersRequest( + {routeLevelHeader: "route-header"}, + undefined, + {headers: {authorization: "Bearer override"}}, + ) + + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + headers: expect.objectContaining({ + authorization: "Bearer override", + "route-level-header": "route-header", + }), + }) + }) + }) + + describe("GET /validation/numbers/random-number", () => { + it("returns a random number", async () => { + const res = await client.getValidationNumbersRandomNumber() + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body).toEqual({ + result: numberBetween(0, 10), + params: { + min: 0, + max: 10, + forbidden: [], + }, + }) + }) + + it("handles a query param array of 1 element", async () => { + const res = await client.getValidationNumbersRandomNumber({ + forbidden: [1], + }) + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body.params).toMatchObject({ + forbidden: [1], + }) + }) + + it("handles a query param array of multiple elements", async () => { + const res = await client.getValidationNumbersRandomNumber({ + forbidden: [1, 2, 3], + }) + expect(res.status).toBe(200) + + const body = await res.json() + + expect(body.params).toMatchObject({ + forbidden: [1, 2, 3], + }) + }) + }) +}) diff --git a/e2e/src/index.spec.ts b/e2e/src/index.spec.ts deleted file mode 100644 index 307c38c9..00000000 --- a/e2e/src/index.spec.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type {Server} from "node:http" -import {beforeAll, describe, expect} from "@jest/globals" -import {ApiClient} from "./generated/client/client" -import {main} from "./index" -import {numberBetween} from "./test-utils" - -describe("e2e", () => { - let server: Server - let client: ApiClient - - beforeAll(async () => { - const args = await main() - client = new ApiClient({ - basePath: `http://localhost:${args.address.port}`, - defaultHeaders: {}, - }) - server = args.server - }) - - afterAll(async () => { - server.close() - }) - - describe("GET /validation/numbers/random-number", () => { - it("returns a random number", async () => { - const res = await client.getValidationNumbersRandomNumber() - expect(res.status).toBe(200) - - const body = await res.json() - - expect(body).toEqual({ - result: numberBetween(0, 10), - params: { - min: 0, - max: 10, - forbidden: [], - }, - }) - }) - - it("handles a query param array of 1 element", async () => { - const res = await client.getValidationNumbersRandomNumber({ - forbidden: [1], - }) - expect(res.status).toBe(200) - - const body = await res.json() - - expect(body.params).toMatchObject({ - forbidden: [1], - }) - }) - - it("handles a query param array of multiple elements", async () => { - const res = await client.getValidationNumbersRandomNumber({ - forbidden: [1, 2, 3], - }) - expect(res.status).toBe(200) - - const body = await res.json() - - expect(body.params).toMatchObject({ - forbidden: [1, 2, 3], - }) - }) - }) -}) diff --git a/e2e/src/index.ts b/e2e/src/index.ts index 300e442d..cd800a23 100644 --- a/e2e/src/index.ts +++ b/e2e/src/index.ts @@ -1,12 +1,15 @@ import Router from "@koa/router" import {bootstrap} from "./generated" +import {createHeadersRouter} from "./routes/headers" import {createValidationRouter} from "./routes/validation" function createRouter() { const router = new Router() + const headersRouter = createHeadersRouter() const validationRouter = createValidationRouter() + router.use(headersRouter.allowedMethods(), headersRouter.routes()) router.use(validationRouter.allowedMethods(), validationRouter.routes()) return router diff --git a/e2e/src/routes/headers.ts b/e2e/src/routes/headers.ts new file mode 100644 index 00000000..741bd482 --- /dev/null +++ b/e2e/src/routes/headers.ts @@ -0,0 +1,12 @@ +import {type GetHeadersRequest, createRouter} from "../generated/routes/headers" + +const getHeadersRequest: GetHeadersRequest = async (_, respond, ctx) => { + return respond.with200().body({headers: ctx.headers}) +} + +export function createHeadersRouter() { + return createRouter({ + getHeadersUndeclared: getHeadersRequest, + getHeadersRequest, + }) +} diff --git a/integration-tests/typescript-axios/src/generated/api.github.com.yaml/client.ts b/integration-tests/typescript-axios/src/generated/api.github.com.yaml/client.ts index a6463a4d..33829cb7 100644 --- a/integration-tests/typescript-axios/src/generated/api.github.com.yaml/client.ts +++ b/integration-tests/typescript-axios/src/generated/api.github.com.yaml/client.ts @@ -316,15 +316,17 @@ export class ApiClient extends AbstractAxiosClient { async metaRoot( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -348,9 +350,10 @@ export class ApiClient extends AbstractAxiosClient { sort?: "updated" | "published" } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/advisories` + const headers = this._headers({}, opts.headers) const query = this._query({ ghsa_id: p["ghsaId"], type: p["type"], @@ -374,7 +377,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -383,29 +387,33 @@ export class ApiClient extends AbstractAxiosClient { ghsaId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/advisories/${p["ghsaId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async appsGetAuthenticated( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -414,7 +422,7 @@ export class ApiClient extends AbstractAxiosClient { code: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse< t_integration & { @@ -427,26 +435,30 @@ export class ApiClient extends AbstractAxiosClient { > > { const url = `/app-manifests/${p["code"]}/conversions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async appsGetWebhookConfigForApp( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/hook/config` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -460,19 +472,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/hook/config` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -483,9 +498,10 @@ export class ApiClient extends AbstractAxiosClient { redelivery?: boolean } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/hook/deliveries` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], cursor: p["cursor"], @@ -496,7 +512,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -505,15 +522,17 @@ export class ApiClient extends AbstractAxiosClient { deliveryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/hook/deliveries/${p["deliveryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -522,19 +541,21 @@ export class ApiClient extends AbstractAxiosClient { deliveryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/app/hook/deliveries/${p["deliveryId"]}/attempts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -544,16 +565,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installation-requests` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -565,9 +588,10 @@ export class ApiClient extends AbstractAxiosClient { outdated?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -579,7 +603,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -588,15 +613,17 @@ export class ApiClient extends AbstractAxiosClient { installationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installations/${p["installationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -605,15 +632,17 @@ export class ApiClient extends AbstractAxiosClient { installationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installations/${p["installationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -627,19 +656,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installations/${p["installationId"]}/access_tokens` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -648,15 +680,17 @@ export class ApiClient extends AbstractAxiosClient { installationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installations/${p["installationId"]}/suspended` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -665,15 +699,17 @@ export class ApiClient extends AbstractAxiosClient { installationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/app/installations/${p["installationId"]}/suspended` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -685,19 +721,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/applications/${p["clientId"]}/grant` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -709,19 +748,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/applications/${p["clientId"]}/token` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -733,19 +775,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/applications/${p["clientId"]}/token` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -757,19 +802,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/applications/${p["clientId"]}/token` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -786,19 +834,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/applications/${p["clientId"]}/token/scoped` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -807,15 +858,17 @@ export class ApiClient extends AbstractAxiosClient { appSlug: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/apps/${p["appSlug"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -824,15 +877,17 @@ export class ApiClient extends AbstractAxiosClient { assignmentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/assignments/${p["assignmentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -843,16 +898,18 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/assignments/${p["assignmentId"]}/accepted_assignments` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -861,15 +918,17 @@ export class ApiClient extends AbstractAxiosClient { assignmentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/assignments/${p["assignmentId"]}/grades` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -879,16 +938,18 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/classrooms` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -897,15 +958,17 @@ export class ApiClient extends AbstractAxiosClient { classroomId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/classrooms/${p["classroomId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -916,30 +979,34 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/classrooms/${p["classroomId"]}/assignments` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async codesOfConductGetAllCodesOfConduct( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/codes_of_conduct` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -948,33 +1015,37 @@ export class ApiClient extends AbstractAxiosClient { key: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/codes_of_conduct/${p["key"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async emojisGet( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: string | undefined }> > { const url = `/emojis` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -985,7 +1056,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ seats?: t_copilot_seat_details[] @@ -993,13 +1064,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/enterprises/${p["enterprise"]}/copilot/billing/seats` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1012,9 +1085,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/enterprises/${p["enterprise"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -1026,7 +1100,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1047,9 +1122,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/enterprises/${p["enterprise"]}/dependabot/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], severity: p["severity"], @@ -1069,7 +1145,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1087,9 +1164,10 @@ export class ApiClient extends AbstractAxiosClient { validity?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/enterprises/${p["enterprise"]}/secret-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], secret_type: p["secretType"], @@ -1106,7 +1184,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1120,9 +1199,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/enterprises/${p["enterprise"]}/team/${p["teamSlug"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -1134,7 +1214,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1144,30 +1225,34 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async activityGetFeeds( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/feeds` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1178,9 +1263,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], @@ -1191,7 +1277,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1210,19 +1297,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1233,9 +1323,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/public` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], @@ -1246,7 +1337,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1257,9 +1349,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/starred` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], @@ -1270,7 +1363,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1279,15 +1373,17 @@ export class ApiClient extends AbstractAxiosClient { gistId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1307,19 +1403,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1328,15 +1427,17 @@ export class ApiClient extends AbstractAxiosClient { gistId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1347,16 +1448,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1368,19 +1471,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1390,15 +1496,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1411,19 +1519,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1433,15 +1544,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1452,16 +1565,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1472,16 +1587,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/forks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1490,15 +1607,17 @@ export class ApiClient extends AbstractAxiosClient { gistId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/forks` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1507,15 +1626,17 @@ export class ApiClient extends AbstractAxiosClient { gistId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/star` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1524,15 +1645,17 @@ export class ApiClient extends AbstractAxiosClient { gistId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/star` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1541,15 +1664,17 @@ export class ApiClient extends AbstractAxiosClient { gistId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/star` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1559,29 +1684,33 @@ export class ApiClient extends AbstractAxiosClient { sha: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gists/${p["gistId"]}/${p["sha"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async gitignoreGetAllTemplates( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gitignore/templates` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1590,15 +1719,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/gitignore/templates/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1608,7 +1739,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_repository[] @@ -1617,27 +1748,31 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/installation/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async appsRevokeInstallationAccessToken( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/installation/token` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1663,9 +1798,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], state: p["state"], @@ -1685,7 +1821,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1696,9 +1833,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/licenses` + const headers = this._headers({}, opts.headers) const query = this._query({ featured: p["featured"], per_page: p["perPage"], @@ -1709,7 +1847,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1718,15 +1857,17 @@ export class ApiClient extends AbstractAxiosClient { license: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/licenses/${p["license"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1739,19 +1880,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/markdown` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1760,19 +1904,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/markdown/raw` - const headers = this._headers({ "Content-Type": "text/plain" }) + const headers = this._headers( + { "Content-Type": "text/plain" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1781,15 +1928,17 @@ export class ApiClient extends AbstractAxiosClient { accountId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/marketplace_listing/accounts/${p["accountId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1799,16 +1948,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/marketplace_listing/plans` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1821,9 +1972,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/marketplace_listing/plans/${p["planId"]}/accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -1835,7 +1987,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1844,15 +1997,17 @@ export class ApiClient extends AbstractAxiosClient { accountId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/marketplace_listing/stubbed/accounts/${p["accountId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1862,16 +2017,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/marketplace_listing/stubbed/plans` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1884,9 +2041,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/marketplace_listing/stubbed/plans/${p["planId"]}/accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -1898,21 +2056,24 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async metaGet( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/meta` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1924,16 +2085,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/networks/${p["owner"]}/${p["repo"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1947,9 +2110,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications` + const headers = this._headers({}, opts.headers) const query = this._query({ all: p["all"], participating: p["participating"], @@ -1963,7 +2127,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1975,7 +2140,7 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse<{ message?: string @@ -1983,16 +2148,19 @@ export class ApiClient extends AbstractAxiosClient { | AxiosResponse > { const url = `/notifications` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2001,15 +2169,17 @@ export class ApiClient extends AbstractAxiosClient { threadId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications/threads/${p["threadId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2018,15 +2188,17 @@ export class ApiClient extends AbstractAxiosClient { threadId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications/threads/${p["threadId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PATCH", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2035,15 +2207,17 @@ export class ApiClient extends AbstractAxiosClient { threadId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications/threads/${p["threadId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2052,15 +2226,17 @@ export class ApiClient extends AbstractAxiosClient { threadId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications/threads/${p["threadId"]}/subscription` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2072,19 +2248,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications/threads/${p["threadId"]}/subscription` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2093,15 +2272,17 @@ export class ApiClient extends AbstractAxiosClient { threadId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/notifications/threads/${p["threadId"]}/subscription` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2110,16 +2291,18 @@ export class ApiClient extends AbstractAxiosClient { s?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/octocat` + const headers = this._headers({}, opts.headers) const query = this._query({ s: p["s"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2129,16 +2312,18 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/organizations` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2147,15 +2332,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2195,19 +2382,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2216,19 +2406,21 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2237,15 +2429,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/cache/usage` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2256,7 +2450,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repository_cache_usages: t_actions_cache_usage_by_repository[] @@ -2264,13 +2458,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/cache/usage-by-repository` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2279,15 +2475,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/oidc/customization/sub` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2297,19 +2495,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_oidc_custom_sub }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/oidc/customization/sub` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2318,15 +2519,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2339,19 +2542,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2362,7 +2568,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_repository[] @@ -2370,13 +2576,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/permissions/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2388,19 +2596,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2410,15 +2621,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2428,15 +2641,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2445,15 +2660,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/selected-actions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2463,19 +2680,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: t_selected_actions }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/selected-actions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2484,15 +2704,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/workflow` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2502,19 +2724,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: t_actions_set_default_workflow_permissions }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/permissions/workflow` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2526,7 +2751,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ runners: t_runner[] @@ -2534,6 +2759,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners` + const headers = this._headers({}, opts.headers) const query = this._query({ name: p["name"], per_page: p["perPage"], @@ -2544,7 +2770,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2553,15 +2780,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/runners/downloads` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2576,7 +2805,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ encoded_jit_config: string @@ -2584,16 +2813,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners/generate-jitconfig` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2602,15 +2834,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/runners/registration-token` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2619,15 +2853,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/runners/remove-token` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2637,15 +2873,17 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2655,15 +2893,17 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2673,7 +2913,7 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -2681,12 +2921,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2699,7 +2941,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -2707,16 +2949,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2729,7 +2974,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -2737,16 +2982,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2756,7 +3004,7 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -2764,12 +3012,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2780,7 +3030,7 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -2788,12 +3038,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2804,7 +3056,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_organization_actions_secret[] @@ -2812,13 +3064,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2827,15 +3081,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2845,15 +3101,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2869,19 +3127,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2891,15 +3152,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2911,7 +3174,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_minimal_repository[] @@ -2919,13 +3182,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2938,19 +3203,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2961,15 +3229,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2980,15 +3250,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2999,7 +3271,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -3007,13 +3279,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3028,19 +3302,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3050,15 +3327,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3074,19 +3353,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3096,15 +3378,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3116,7 +3400,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_minimal_repository[] @@ -3124,13 +3408,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3143,19 +3429,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3166,15 +3455,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3185,15 +3476,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3206,7 +3499,7 @@ export class ApiClient extends AbstractAxiosClient { subjectDigest: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ attestations?: { @@ -3224,6 +3517,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/attestations/${p["subjectDigest"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], @@ -3234,7 +3528,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3245,16 +3540,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/blocks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3264,15 +3561,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3282,15 +3581,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3300,15 +3601,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3327,9 +3630,10 @@ export class ApiClient extends AbstractAxiosClient { severity?: t_code_scanning_alert_severity }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ tool_name: p["toolName"], tool_guid: p["toolGuid"], @@ -3347,7 +3651,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3360,9 +3665,10 @@ export class ApiClient extends AbstractAxiosClient { after?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations` + const headers = this._headers({}, opts.headers) const query = this._query({ target_type: p["targetType"], per_page: p["perPage"], @@ -3374,7 +3680,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3401,19 +3708,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3422,15 +3732,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations/defaults` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3442,19 +3754,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations/detach` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3464,15 +3779,17 @@ export class ApiClient extends AbstractAxiosClient { configurationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3500,21 +3817,24 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse | AxiosResponse > { const url = `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3524,15 +3844,17 @@ export class ApiClient extends AbstractAxiosClient { configurationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3546,23 +3868,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}/attach` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3579,7 +3904,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ configuration?: t_code_security_configuration @@ -3587,16 +3912,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}/defaults` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3610,9 +3938,10 @@ export class ApiClient extends AbstractAxiosClient { status?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], @@ -3624,7 +3953,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3635,7 +3965,7 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ codespaces: t_codespace[] @@ -3643,13 +3973,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3666,19 +3998,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/access` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3690,19 +4025,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/access/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3714,19 +4052,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/access/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3737,7 +4078,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_codespaces_org_secret[] @@ -3745,13 +4086,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/codespaces/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3760,15 +4103,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3778,15 +4123,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3802,19 +4149,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3824,15 +4174,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3844,7 +4196,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_minimal_repository[] @@ -3852,13 +4204,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3871,19 +4225,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3894,15 +4251,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3913,15 +4272,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3930,15 +4291,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/copilot/billing` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3949,7 +4312,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ seats?: t_copilot_seat_details[] @@ -3957,13 +4320,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/copilot/billing/seats` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3975,23 +4340,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ seats_created: number }> > { const url = `/orgs/${p["org"]}/copilot/billing/selected_teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4003,23 +4371,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ seats_cancelled: number }> > { const url = `/orgs/${p["org"]}/copilot/billing/selected_teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4031,23 +4402,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ seats_created: number }> > { const url = `/orgs/${p["org"]}/copilot/billing/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4059,23 +4433,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ seats_cancelled: number }> > { const url = `/orgs/${p["org"]}/copilot/billing/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4088,9 +4465,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -4102,7 +4480,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4123,9 +4502,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], severity: p["severity"], @@ -4145,7 +4525,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4156,7 +4537,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_organization_dependabot_secret[] @@ -4164,13 +4545,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/dependabot/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4179,15 +4562,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4197,15 +4582,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4221,19 +4608,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4243,15 +4633,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4263,7 +4655,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_minimal_repository[] @@ -4271,13 +4663,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4290,19 +4684,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4313,15 +4710,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4332,15 +4731,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4349,15 +4750,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/docker/conflicts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4368,16 +4771,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4388,16 +4793,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/failed_invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4408,16 +4815,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4439,19 +4848,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4461,15 +4873,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4490,19 +4904,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4512,15 +4929,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4530,15 +4949,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}/config` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4554,19 +4975,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}/config` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4579,9 +5003,10 @@ export class ApiClient extends AbstractAxiosClient { redelivery?: boolean }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}/deliveries` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], cursor: p["cursor"], @@ -4592,7 +5017,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4603,15 +5029,17 @@ export class ApiClient extends AbstractAxiosClient { deliveryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4622,19 +5050,21 @@ export class ApiClient extends AbstractAxiosClient { deliveryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}/attempts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4644,15 +5074,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/hooks/${p["hookId"]}/pings` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4661,15 +5093,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/installation` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4680,7 +5114,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ installations: t_installation[] @@ -4688,13 +5122,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/installations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4703,15 +5139,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/interaction-limits` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4721,19 +5159,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_interaction_limit }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/interaction-limits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4742,15 +5183,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/interaction-limits` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4768,9 +5211,10 @@ export class ApiClient extends AbstractAxiosClient { invitationSource?: "all" | "member" | "scim" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -4782,7 +5226,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4797,19 +5242,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/invitations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4819,15 +5267,17 @@ export class ApiClient extends AbstractAxiosClient { invitationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4839,16 +5289,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/invitations/${p["invitationId"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4871,9 +5323,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], state: p["state"], @@ -4889,7 +5342,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4902,9 +5356,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/members` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], role: p["role"], @@ -4916,7 +5371,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4926,15 +5382,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4944,15 +5402,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4964,7 +5424,7 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ codespaces: t_codespace[] @@ -4972,13 +5432,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/members/${p["username"]}/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4989,19 +5451,21 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/orgs/${p["org"]}/members/${p["username"]}/codespaces/${p["codespaceName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5012,15 +5476,17 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/members/${p["username"]}/codespaces/${p["codespaceName"]}/stop` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5030,15 +5496,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/members/${p["username"]}/copilot` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5048,15 +5516,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5069,19 +5539,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/memberships/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5091,15 +5564,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5111,9 +5586,10 @@ export class ApiClient extends AbstractAxiosClient { exclude?: "repositories"[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -5124,7 +5600,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5144,19 +5621,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5167,16 +5647,18 @@ export class ApiClient extends AbstractAxiosClient { exclude?: "repositories"[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations/${p["migrationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude: p["exclude"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5186,15 +5668,17 @@ export class ApiClient extends AbstractAxiosClient { migrationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5204,15 +5688,17 @@ export class ApiClient extends AbstractAxiosClient { migrationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5223,15 +5709,17 @@ export class ApiClient extends AbstractAxiosClient { repoName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations/${p["migrationId"]}/repos/${p["repoName"]}/lock` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5243,16 +5731,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/migrations/${p["migrationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5261,7 +5751,7 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ roles?: t_organization_role[] @@ -5269,12 +5759,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/orgs/${p["org"]}/organization-roles` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5284,15 +5776,17 @@ export class ApiClient extends AbstractAxiosClient { teamSlug: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5303,15 +5797,17 @@ export class ApiClient extends AbstractAxiosClient { roleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/teams/${p["teamSlug"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5322,15 +5818,17 @@ export class ApiClient extends AbstractAxiosClient { roleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/teams/${p["teamSlug"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5340,15 +5838,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/users/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5359,15 +5859,17 @@ export class ApiClient extends AbstractAxiosClient { roleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/users/${p["username"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5378,15 +5880,17 @@ export class ApiClient extends AbstractAxiosClient { roleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/users/${p["username"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5396,15 +5900,17 @@ export class ApiClient extends AbstractAxiosClient { roleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/${p["roleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5416,16 +5922,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/${p["roleId"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5437,16 +5945,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/organization-roles/${p["roleId"]}/users` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5458,9 +5968,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/outside_collaborators` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], per_page: p["perPage"], @@ -5471,7 +5982,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5484,19 +5996,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/orgs/${p["org"]}/outside_collaborators/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5506,15 +6021,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/outside_collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5533,9 +6050,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages` + const headers = this._headers({}, opts.headers) const query = this._query({ package_type: p["packageType"], visibility: p["visibility"], @@ -5547,7 +6065,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5564,15 +6083,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5589,15 +6110,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5615,16 +6138,18 @@ export class ApiClient extends AbstractAxiosClient { token?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/restore` + const headers = this._headers({}, opts.headers) const query = this._query({ token: p["token"] }) return this._request({ url: url + query, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5644,9 +6169,10 @@ export class ApiClient extends AbstractAxiosClient { state?: "active" | "deleted" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"], @@ -5657,7 +6183,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5675,15 +6202,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5701,15 +6230,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5727,15 +6258,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}/restore` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5753,11 +6286,12 @@ export class ApiClient extends AbstractAxiosClient { lastUsedAfter?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse > { const url = `/orgs/${p["org"]}/personal-access-token-requests` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -5774,7 +6308,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5788,23 +6323,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/orgs/${p["org"]}/personal-access-token-requests` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5818,19 +6356,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/personal-access-token-requests/${p["patRequestId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5842,16 +6383,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/personal-access-token-requests/${p["patRequestId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5869,9 +6412,10 @@ export class ApiClient extends AbstractAxiosClient { lastUsedAfter?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/personal-access-tokens` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -5888,7 +6432,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5901,23 +6446,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/orgs/${p["org"]}/personal-access-tokens` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5930,19 +6478,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/personal-access-tokens/${p["patId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5954,16 +6505,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/personal-access-tokens/${p["patId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5975,9 +6528,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], @@ -5988,7 +6542,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6001,19 +6556,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/projects` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6022,15 +6580,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/schema` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6042,19 +6602,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/schema` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6064,15 +6627,17 @@ export class ApiClient extends AbstractAxiosClient { customPropertyName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/schema/${p["customPropertyName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6089,19 +6654,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/schema/${p["customPropertyName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6111,15 +6679,17 @@ export class ApiClient extends AbstractAxiosClient { customPropertyName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/schema/${p["customPropertyName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6131,9 +6701,10 @@ export class ApiClient extends AbstractAxiosClient { repositoryQuery?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/values` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -6144,7 +6715,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6157,19 +6729,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/properties/values` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6180,16 +6755,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/public_members` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6199,15 +6776,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/public_members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6217,15 +6796,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/public_members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6235,15 +6816,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/public_members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6257,9 +6840,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ type: p["type"], sort: p["sort"], @@ -6272,7 +6856,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6310,19 +6895,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/repos` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6333,16 +6921,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6359,19 +6949,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6387,9 +6980,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets/rule-suites` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], repository_name: p["repositoryName"], @@ -6404,7 +6998,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6414,15 +7009,17 @@ export class ApiClient extends AbstractAxiosClient { ruleSuiteId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets/rule-suites/${p["ruleSuiteId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6432,15 +7029,17 @@ export class ApiClient extends AbstractAxiosClient { rulesetId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6458,19 +7057,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets/${p["rulesetId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6480,15 +7082,17 @@ export class ApiClient extends AbstractAxiosClient { rulesetId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6507,9 +7111,10 @@ export class ApiClient extends AbstractAxiosClient { validity?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/secret-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], secret_type: p["secretType"], @@ -6527,7 +7132,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6542,9 +7148,10 @@ export class ApiClient extends AbstractAxiosClient { state?: "triage" | "draft" | "published" | "closed" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/security-advisories` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], sort: p["sort"], @@ -6558,7 +7165,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6567,15 +7175,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/security-managers` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6585,15 +7195,17 @@ export class ApiClient extends AbstractAxiosClient { teamSlug: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/security-managers/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6603,15 +7215,17 @@ export class ApiClient extends AbstractAxiosClient { teamSlug: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/security-managers/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6620,15 +7234,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/settings/billing/actions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6637,15 +7253,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/settings/billing/packages` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6654,15 +7272,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/settings/billing/shared-storage` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6676,9 +7296,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/team/${p["teamSlug"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -6690,7 +7311,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6701,16 +7323,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6731,19 +7355,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6753,15 +7380,17 @@ export class ApiClient extends AbstractAxiosClient { teamSlug: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6781,19 +7410,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6803,15 +7435,17 @@ export class ApiClient extends AbstractAxiosClient { teamSlug: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6825,9 +7459,10 @@ export class ApiClient extends AbstractAxiosClient { pinned?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -6839,7 +7474,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6854,19 +7490,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6877,15 +7516,17 @@ export class ApiClient extends AbstractAxiosClient { discussionNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6900,19 +7541,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6923,15 +7567,17 @@ export class ApiClient extends AbstractAxiosClient { discussionNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6945,9 +7591,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -6958,7 +7605,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6972,19 +7620,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6996,15 +7647,17 @@ export class ApiClient extends AbstractAxiosClient { commentNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7019,19 +7672,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7043,15 +7699,17 @@ export class ApiClient extends AbstractAxiosClient { commentNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7074,9 +7732,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -7087,7 +7746,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7110,19 +7770,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7135,15 +7798,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7165,9 +7830,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -7178,7 +7844,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7200,19 +7867,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7224,15 +7894,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7244,16 +7916,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7266,9 +7940,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/members` + const headers = this._headers({}, opts.headers) const query = this._query({ role: p["role"], per_page: p["perPage"], @@ -7279,7 +7954,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7290,15 +7966,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7312,19 +7990,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/memberships/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7335,15 +8016,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7355,16 +8038,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7375,15 +8060,17 @@ export class ApiClient extends AbstractAxiosClient { projectId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7397,19 +8084,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects/${p["projectId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7420,15 +8110,17 @@ export class ApiClient extends AbstractAxiosClient { projectId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7440,16 +8132,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7461,15 +8155,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7484,19 +8180,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos/${p["owner"]}/${p["repo"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7508,15 +8207,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7528,16 +8229,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/teams/${p["teamSlug"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7558,19 +8261,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/orgs/${p["org"]}/${p["securityProduct"]}/${p["enablement"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7579,15 +8285,17 @@ export class ApiClient extends AbstractAxiosClient { cardId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/cards/${p["cardId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7600,19 +8308,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/cards/${p["cardId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7621,15 +8332,17 @@ export class ApiClient extends AbstractAxiosClient { cardId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/cards/${p["cardId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7642,19 +8355,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/cards/${p["cardId"]}/moves` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7663,15 +8379,17 @@ export class ApiClient extends AbstractAxiosClient { columnId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/${p["columnId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7683,19 +8401,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/${p["columnId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7704,15 +8425,17 @@ export class ApiClient extends AbstractAxiosClient { columnId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/${p["columnId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7724,9 +8447,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/${p["columnId"]}/cards` + const headers = this._headers({}, opts.headers) const query = this._query({ archived_state: p["archivedState"], per_page: p["perPage"], @@ -7737,7 +8461,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7754,19 +8479,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/${p["columnId"]}/cards` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7778,19 +8506,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/columns/${p["columnId"]}/moves` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7799,15 +8530,17 @@ export class ApiClient extends AbstractAxiosClient { projectId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7823,19 +8556,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7844,15 +8580,17 @@ export class ApiClient extends AbstractAxiosClient { projectId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7864,9 +8602,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}/collaborators` + const headers = this._headers({}, opts.headers) const query = this._query({ affiliation: p["affiliation"], per_page: p["perPage"], @@ -7877,7 +8616,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7890,19 +8630,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}/collaborators/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7912,15 +8655,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}/collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7930,15 +8675,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}/collaborators/${p["username"]}/permission` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7949,16 +8696,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}/columns` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7970,33 +8719,38 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/projects/${p["projectId"]}/columns` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async rateLimitGet( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/rate_limit` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8006,15 +8760,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8064,19 +8820,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8086,15 +8845,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8107,7 +8868,7 @@ export class ApiClient extends AbstractAxiosClient { name?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ artifacts: t_artifact[] @@ -8115,6 +8876,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -8125,7 +8887,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8136,15 +8899,17 @@ export class ApiClient extends AbstractAxiosClient { artifactId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts/${p["artifactId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8155,15 +8920,17 @@ export class ApiClient extends AbstractAxiosClient { artifactId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts/${p["artifactId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8175,15 +8942,17 @@ export class ApiClient extends AbstractAxiosClient { archiveFormat: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts/${p["artifactId"]}/${p["archiveFormat"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8193,15 +8962,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/cache/usage` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8217,9 +8988,10 @@ export class ApiClient extends AbstractAxiosClient { direction?: "asc" | "desc" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/caches` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -8233,7 +9005,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8245,16 +9018,18 @@ export class ApiClient extends AbstractAxiosClient { ref?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/caches` + const headers = this._headers({}, opts.headers) const query = this._query({ key: p["key"], ref: p["ref"] }) return this._request({ url: url + query, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8265,15 +9040,17 @@ export class ApiClient extends AbstractAxiosClient { cacheId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/caches/${p["cacheId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8284,15 +9061,17 @@ export class ApiClient extends AbstractAxiosClient { jobId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/jobs/${p["jobId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8303,15 +9082,17 @@ export class ApiClient extends AbstractAxiosClient { jobId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/jobs/${p["jobId"]}/logs` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8325,19 +9106,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/jobs/${p["jobId"]}/rerun` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8347,15 +9131,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/oidc/customization/sub` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8369,19 +9155,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/oidc/customization/sub` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8393,7 +9182,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_actions_secret[] @@ -8401,13 +9190,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/organization-secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8419,7 +9210,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -8427,13 +9218,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/organization-variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8443,15 +9236,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8465,19 +9260,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8487,15 +9285,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/access` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8506,19 +9306,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_actions_workflow_access_to_repository }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/access` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8528,15 +9331,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/selected-actions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8547,19 +9352,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: t_selected_actions }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/selected-actions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8569,15 +9377,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/workflow` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8588,19 +9398,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_actions_set_default_workflow_permissions }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/workflow` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8613,7 +9426,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ runners: t_runner[] @@ -8621,6 +9434,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners` + const headers = this._headers({}, opts.headers) const query = this._query({ name: p["name"], per_page: p["perPage"], @@ -8631,7 +9445,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8641,15 +9456,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/downloads` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8665,7 +9482,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ encoded_jit_config: string @@ -8673,16 +9490,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/generate-jitconfig` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8692,15 +9512,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/registration-token` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8710,15 +9532,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/remove-token` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8729,15 +9553,17 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8748,15 +9574,17 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8767,7 +9595,7 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -8775,12 +9603,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8794,7 +9624,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -8802,16 +9632,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8825,7 +9658,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -8833,16 +9666,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8853,7 +9689,7 @@ export class ApiClient extends AbstractAxiosClient { runnerId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -8861,12 +9697,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8878,7 +9716,7 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ labels: t_runner_label[] @@ -8886,12 +9724,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8925,7 +9765,7 @@ export class ApiClient extends AbstractAxiosClient { headSha?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -8933,6 +9773,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs` + const headers = this._headers({}, opts.headers) const query = this._query({ actor: p["actor"], branch: p["branch"], @@ -8950,7 +9791,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8962,9 +9804,10 @@ export class ApiClient extends AbstractAxiosClient { excludePullRequests?: boolean }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude_pull_requests: p["excludePullRequests"], }) @@ -8973,7 +9816,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8984,15 +9828,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9003,15 +9849,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/approvals` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9022,15 +9870,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/approve` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9044,7 +9894,7 @@ export class ApiClient extends AbstractAxiosClient { name?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ artifacts: t_artifact[] @@ -9052,6 +9902,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/artifacts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -9062,7 +9913,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9075,9 +9927,10 @@ export class ApiClient extends AbstractAxiosClient { excludePullRequests?: boolean }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/attempts/${p["attemptNumber"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude_pull_requests: p["excludePullRequests"], }) @@ -9086,7 +9939,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9100,7 +9954,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ jobs: t_job[] @@ -9108,13 +9962,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/attempts/${p["attemptNumber"]}/jobs` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9126,15 +9982,17 @@ export class ApiClient extends AbstractAxiosClient { attemptNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/attempts/${p["attemptNumber"]}/logs` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9145,15 +10003,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/cancel` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9167,19 +10027,22 @@ export class ApiClient extends AbstractAxiosClient { | t_review_custom_gates_state_required }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/deployment_protection_rule` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9190,15 +10053,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/force-cancel` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9212,7 +10077,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ jobs: t_job[] @@ -9220,6 +10085,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/jobs` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], per_page: p["perPage"], @@ -9230,7 +10096,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9241,15 +10108,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/logs` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9260,15 +10129,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/logs` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9279,15 +10150,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/pending_deployments` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9303,19 +10176,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/pending_deployments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9329,19 +10205,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/rerun` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9355,19 +10234,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/rerun-failed-jobs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9378,15 +10260,17 @@ export class ApiClient extends AbstractAxiosClient { runId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/timing` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9398,7 +10282,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_actions_secret[] @@ -9406,13 +10290,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9422,15 +10308,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9441,15 +10329,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9464,19 +10354,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9487,15 +10380,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9507,7 +10402,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -9515,13 +10410,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9535,19 +10432,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/variables` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9558,15 +10458,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9581,19 +10483,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/variables/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9604,15 +10509,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9624,7 +10531,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -9632,13 +10539,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9649,15 +10558,17 @@ export class ApiClient extends AbstractAxiosClient { workflowId: number | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9668,15 +10579,17 @@ export class ApiClient extends AbstractAxiosClient { workflowId: number | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/disable` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9693,19 +10606,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/dispatches` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9716,15 +10632,17 @@ export class ApiClient extends AbstractAxiosClient { workflowId: number | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/enable` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9759,7 +10677,7 @@ export class ApiClient extends AbstractAxiosClient { headSha?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -9767,6 +10685,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/runs` + const headers = this._headers({}, opts.headers) const query = this._query({ actor: p["actor"], branch: p["branch"], @@ -9784,7 +10703,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9795,15 +10715,17 @@ export class ApiClient extends AbstractAxiosClient { workflowId: number | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/timing` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9827,9 +10749,10 @@ export class ApiClient extends AbstractAxiosClient { | "merge_queue_merge" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/activity` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -9845,7 +10768,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9857,16 +10781,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/assignees` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9877,15 +10803,17 @@ export class ApiClient extends AbstractAxiosClient { assignee: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/assignees/${p["assignee"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9906,23 +10834,26 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ id?: number }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/attestations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9936,7 +10867,7 @@ export class ApiClient extends AbstractAxiosClient { subjectDigest: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ attestations?: { @@ -9954,6 +10885,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/attestations/${p["subjectDigest"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], @@ -9964,7 +10896,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9974,15 +10907,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/autolinks` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9997,19 +10932,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/autolinks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10020,15 +10958,17 @@ export class ApiClient extends AbstractAxiosClient { autolinkId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/autolinks/${p["autolinkId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10039,15 +10979,17 @@ export class ApiClient extends AbstractAxiosClient { autolinkId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/autolinks/${p["autolinkId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10057,15 +10999,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/automated-security-fixes` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10075,15 +11019,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/automated-security-fixes` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10093,15 +11039,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/automated-security-fixes` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10114,9 +11062,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches` + const headers = this._headers({}, opts.headers) const query = this._query({ protected: p["protected"], per_page: p["perPage"], @@ -10127,7 +11076,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10138,15 +11088,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10157,15 +11109,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10215,19 +11169,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10238,15 +11195,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10257,15 +11216,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/enforce_admins` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10276,15 +11237,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/enforce_admins` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10295,15 +11258,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/enforce_admins` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10314,15 +11279,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_pull_request_reviews` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10349,19 +11316,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_pull_request_reviews` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10372,15 +11342,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_pull_request_reviews` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10391,15 +11363,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_signatures` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10410,15 +11384,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_signatures` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10429,15 +11405,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_signatures` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10448,15 +11426,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10475,19 +11455,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10498,15 +11481,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10517,15 +11502,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10541,19 +11528,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10569,19 +11559,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10597,19 +11590,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10620,15 +11616,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10639,15 +11637,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10658,15 +11658,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10682,19 +11684,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10710,19 +11715,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10738,19 +11746,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10761,15 +11772,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10785,19 +11798,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10813,19 +11829,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10841,19 +11860,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10864,15 +11886,17 @@ export class ApiClient extends AbstractAxiosClient { branch: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10888,19 +11912,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10916,19 +11943,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10944,19 +11974,22 @@ export class ApiClient extends AbstractAxiosClient { | string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10970,19 +12003,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/rename` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11001,19 +12037,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-runs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11024,15 +12063,17 @@ export class ApiClient extends AbstractAxiosClient { checkRunId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11092,19 +12133,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11117,16 +12161,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}/annotations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11137,15 +12183,17 @@ export class ApiClient extends AbstractAxiosClient { checkRunId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}/rerequest` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11158,19 +12206,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-suites` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11186,19 +12237,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-suites/preferences` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11209,15 +12263,17 @@ export class ApiClient extends AbstractAxiosClient { checkSuiteId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-suites/${p["checkSuiteId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11233,7 +12289,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ check_runs: t_check_run[] @@ -11241,6 +12297,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/check-suites/${p["checkSuiteId"]}/check-runs` + const headers = this._headers({}, opts.headers) const query = this._query({ check_name: p["checkName"], status: p["status"], @@ -11253,7 +12310,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11264,15 +12322,17 @@ export class ApiClient extends AbstractAxiosClient { checkSuiteId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/check-suites/${p["checkSuiteId"]}/rerequest` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11291,9 +12351,10 @@ export class ApiClient extends AbstractAxiosClient { severity?: t_code_scanning_alert_severity }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ tool_name: p["toolName"], tool_guid: p["toolGuid"], @@ -11310,7 +12371,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11321,15 +12383,17 @@ export class ApiClient extends AbstractAxiosClient { alertNumber: t_alert_number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts/${p["alertNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11345,19 +12409,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts/${p["alertNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11371,9 +12438,10 @@ export class ApiClient extends AbstractAxiosClient { ref?: t_code_scanning_ref }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts/${p["alertNumber"]}/instances` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"], @@ -11384,7 +12452,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11402,9 +12471,10 @@ export class ApiClient extends AbstractAxiosClient { sort?: "created" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/analyses` + const headers = this._headers({}, opts.headers) const query = this._query({ tool_name: p["toolName"], tool_guid: p["toolGuid"], @@ -11420,7 +12490,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11431,19 +12502,21 @@ export class ApiClient extends AbstractAxiosClient { analysisId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/analyses/${p["analysisId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11455,16 +12528,18 @@ export class ApiClient extends AbstractAxiosClient { confirmDelete?: string | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/analyses/${p["analysisId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ confirm_delete: p["confirmDelete"] }) return this._request({ url: url + query, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11474,15 +12549,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/databases` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11493,15 +12570,17 @@ export class ApiClient extends AbstractAxiosClient { language: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/databases/${p["language"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11512,19 +12591,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/variant-analyses` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11535,15 +12617,17 @@ export class ApiClient extends AbstractAxiosClient { codeqlVariantAnalysisId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/variant-analyses/${p["codeqlVariantAnalysisId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11556,15 +12640,17 @@ export class ApiClient extends AbstractAxiosClient { repoName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/variant-analyses/${p["codeqlVariantAnalysisId"]}/repos/${p["repoOwner"]}/${p["repoName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11574,15 +12660,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/default-setup` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11593,22 +12681,25 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_code_scanning_default_setup_update }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/default-setup` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11627,19 +12718,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/sarifs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11650,15 +12744,17 @@ export class ApiClient extends AbstractAxiosClient { sarifId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/code-scanning/sarifs/${p["sarifId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11668,18 +12764,20 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/code-security-configuration` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11690,16 +12788,18 @@ export class ApiClient extends AbstractAxiosClient { ref?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/codeowners/errors` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11711,7 +12811,7 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ codespaces: t_codespace[] @@ -11719,13 +12819,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11748,19 +12850,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11772,7 +12877,7 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ devcontainers: { @@ -11784,13 +12889,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/devcontainers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11803,7 +12910,7 @@ export class ApiClient extends AbstractAxiosClient { ref?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ machines: t_codespace_machine[] @@ -11811,6 +12918,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/machines` + const headers = this._headers({}, opts.headers) const query = this._query({ location: p["location"], client_ip: p["clientIp"], @@ -11821,7 +12929,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11833,7 +12942,7 @@ export class ApiClient extends AbstractAxiosClient { clientIp?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ billable_owner?: t_simple_user @@ -11844,13 +12953,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/new` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], client_ip: p["clientIp"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11862,9 +12973,10 @@ export class ApiClient extends AbstractAxiosClient { devcontainerPath: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/permissions_check` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], devcontainer_path: p["devcontainerPath"], @@ -11874,7 +12986,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11886,7 +12999,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_repo_codespaces_secret[] @@ -11894,13 +13007,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11910,15 +13025,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11929,15 +13046,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11952,19 +13071,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11975,15 +13097,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11997,9 +13121,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/collaborators` + const headers = this._headers({}, opts.headers) const query = this._query({ affiliation: p["affiliation"], permission: p["permission"], @@ -12011,7 +13136,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12022,15 +13148,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12044,19 +13172,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12067,15 +13198,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12086,15 +13219,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}/permission` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12106,16 +13241,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12126,15 +13263,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12148,19 +13287,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12171,15 +13313,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12201,9 +13345,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -12214,7 +13359,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12236,19 +13382,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12260,15 +13409,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12286,9 +13437,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ sha: p["sha"], path: p["path"], @@ -12304,7 +13456,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12315,15 +13468,17 @@ export class ApiClient extends AbstractAxiosClient { commitSha: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/branches-where-head` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12336,16 +13491,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12362,19 +13519,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12387,16 +13547,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/pulls` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12409,16 +13571,18 @@ export class ApiClient extends AbstractAxiosClient { ref: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12435,7 +13599,7 @@ export class ApiClient extends AbstractAxiosClient { appId?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ check_runs: t_check_run[] @@ -12443,6 +13607,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/check-runs` + const headers = this._headers({}, opts.headers) const query = this._query({ check_name: p["checkName"], status: p["status"], @@ -12456,7 +13621,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12471,7 +13637,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ check_suites: t_check_suite[] @@ -12479,6 +13645,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/check-suites` + const headers = this._headers({}, opts.headers) const query = this._query({ app_id: p["appId"], check_name: p["checkName"], @@ -12490,7 +13657,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12503,16 +13671,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/status` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12525,16 +13695,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/statuses` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12544,15 +13716,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/community/profile` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12565,16 +13739,18 @@ export class ApiClient extends AbstractAxiosClient { basehead: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/compare/${p["basehead"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12586,7 +13762,7 @@ export class ApiClient extends AbstractAxiosClient { ref?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse< | t_content_directory @@ -12596,13 +13772,15 @@ export class ApiClient extends AbstractAxiosClient { > > { const url = `/repos/${p["owner"]}/${p["repo"]}/contents/${p["path"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12629,19 +13807,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/contents/${p["path"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12665,19 +13846,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/contents/${p["path"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12690,9 +13874,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/contributors` + const headers = this._headers({}, opts.headers) const query = this._query({ anon: p["anon"], per_page: p["perPage"], @@ -12703,7 +13888,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12727,9 +13913,10 @@ export class ApiClient extends AbstractAxiosClient { last?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], severity: p["severity"], @@ -12751,7 +13938,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12762,15 +13950,17 @@ export class ApiClient extends AbstractAxiosClient { alertNumber: t_alert_number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/alerts/${p["alertNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12791,19 +13981,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/alerts/${p["alertNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12815,7 +14008,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_dependabot_secret[] @@ -12823,13 +14016,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12839,15 +14034,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12858,15 +14055,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12881,19 +14080,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12904,15 +14106,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12924,16 +14128,18 @@ export class ApiClient extends AbstractAxiosClient { name?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependency-graph/compare/${p["basehead"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ name: p["name"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12943,15 +14149,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dependency-graph/sbom` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12962,7 +14170,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_snapshot }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ created_at: string @@ -12972,16 +14180,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/dependency-graph/snapshots` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12997,9 +14208,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments` + const headers = this._headers({}, opts.headers) const query = this._query({ sha: p["sha"], ref: p["ref"], @@ -13013,7 +14225,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13038,7 +14251,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse<{ @@ -13046,16 +14259,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13066,15 +14282,17 @@ export class ApiClient extends AbstractAxiosClient { deploymentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13085,15 +14303,17 @@ export class ApiClient extends AbstractAxiosClient { deploymentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13106,16 +14326,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}/statuses` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13142,19 +14364,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}/statuses` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13166,15 +14391,17 @@ export class ApiClient extends AbstractAxiosClient { statusId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}/statuses/${p["statusId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13190,19 +14417,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/dispatches` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13214,7 +14444,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ environments?: t_environment[] @@ -13222,13 +14452,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/environments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13239,15 +14471,17 @@ export class ApiClient extends AbstractAxiosClient { environmentName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13269,19 +14503,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13292,15 +14529,17 @@ export class ApiClient extends AbstractAxiosClient { environmentName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13313,7 +14552,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ branch_policies: t_deployment_branch_policy[] @@ -13321,13 +14560,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13339,19 +14580,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_deployment_branch_policy_name_pattern_with_type }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13363,15 +14607,17 @@ export class ApiClient extends AbstractAxiosClient { branchPolicyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies/${p["branchPolicyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13384,19 +14630,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_deployment_branch_policy_name_pattern }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies/${p["branchPolicyId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13408,15 +14657,17 @@ export class ApiClient extends AbstractAxiosClient { branchPolicyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies/${p["branchPolicyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13427,7 +14678,7 @@ export class ApiClient extends AbstractAxiosClient { owner: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ custom_deployment_protection_rules?: t_deployment_protection_rule[] @@ -13435,12 +14686,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13454,19 +14707,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13479,7 +14735,7 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ available_custom_deployment_protection_rule_integrations?: t_custom_deployment_rule_app[] @@ -13487,13 +14743,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules/apps` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13505,15 +14763,17 @@ export class ApiClient extends AbstractAxiosClient { protectionRuleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules/${p["protectionRuleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13525,15 +14785,17 @@ export class ApiClient extends AbstractAxiosClient { protectionRuleId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules/${p["protectionRuleId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13546,7 +14808,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_actions_secret[] @@ -13554,13 +14816,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13571,15 +14835,17 @@ export class ApiClient extends AbstractAxiosClient { environmentName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13591,15 +14857,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13615,19 +14883,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13639,15 +14910,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13660,7 +14933,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ total_count: number @@ -13668,13 +14941,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13689,19 +14964,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13713,15 +14991,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13737,19 +15017,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13761,15 +15044,17 @@ export class ApiClient extends AbstractAxiosClient { environmentName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13781,16 +15066,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13803,9 +15090,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/forks` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], per_page: p["perPage"], @@ -13816,7 +15104,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13831,19 +15120,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/forks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13857,19 +15149,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/blobs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13880,15 +15175,17 @@ export class ApiClient extends AbstractAxiosClient { fileSha: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/blobs/${p["fileSha"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13914,19 +15211,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/commits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13937,15 +15237,17 @@ export class ApiClient extends AbstractAxiosClient { commitSha: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/commits/${p["commitSha"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13956,15 +15258,17 @@ export class ApiClient extends AbstractAxiosClient { ref: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/matching-refs/${p["ref"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13975,15 +15279,17 @@ export class ApiClient extends AbstractAxiosClient { ref: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/ref/${p["ref"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13997,19 +15303,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/refs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14024,19 +15333,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/refs/${p["ref"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14047,15 +15359,17 @@ export class ApiClient extends AbstractAxiosClient { ref: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/refs/${p["ref"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14076,19 +15390,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/tags` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14099,15 +15416,17 @@ export class ApiClient extends AbstractAxiosClient { tagSha: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/tags/${p["tagSha"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14127,19 +15446,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/trees` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14151,16 +15473,18 @@ export class ApiClient extends AbstractAxiosClient { recursive?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/git/trees/${p["treeSha"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ recursive: p["recursive"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14172,16 +15496,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14202,19 +15528,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14225,15 +15554,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14251,19 +15582,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14274,15 +15608,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14293,15 +15629,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/config` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14318,19 +15656,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/config` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14344,9 +15685,10 @@ export class ApiClient extends AbstractAxiosClient { redelivery?: boolean }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/deliveries` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], cursor: p["cursor"], @@ -14357,7 +15699,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14369,15 +15712,17 @@ export class ApiClient extends AbstractAxiosClient { deliveryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14389,19 +15734,21 @@ export class ApiClient extends AbstractAxiosClient { deliveryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}/attempts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14412,15 +15759,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/pings` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14431,15 +15780,17 @@ export class ApiClient extends AbstractAxiosClient { hookId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/tests` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14449,15 +15800,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14474,19 +15827,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14502,19 +15858,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14524,15 +15883,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14543,16 +15904,18 @@ export class ApiClient extends AbstractAxiosClient { since?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import/authors` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14567,19 +15930,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import/authors/${p["authorId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14589,15 +15955,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import/large_files` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14610,19 +15978,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/import/lfs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14632,15 +16003,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/installation` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14650,15 +16023,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/interaction-limits` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14669,19 +16044,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_interaction_limit }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/interaction-limits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14691,15 +16069,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/interaction-limits` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14711,16 +16091,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14734,19 +16116,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/invitations/${p["invitationId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14757,15 +16142,17 @@ export class ApiClient extends AbstractAxiosClient { invitationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14786,9 +16173,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ milestone: p["milestone"], state: p["state"], @@ -14807,7 +16195,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14833,19 +16222,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14860,9 +16252,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -14875,7 +16268,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14886,15 +16280,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14908,19 +16304,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14931,15 +16330,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14961,9 +16362,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -14974,7 +16376,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14996,19 +16399,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15020,15 +16426,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15040,16 +16448,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15060,15 +16470,17 @@ export class ApiClient extends AbstractAxiosClient { eventId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/events/${p["eventId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15079,15 +16491,17 @@ export class ApiClient extends AbstractAxiosClient { issueNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15116,19 +16530,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15142,19 +16559,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/assignees` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15168,19 +16588,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/assignees` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15192,15 +16615,17 @@ export class ApiClient extends AbstractAxiosClient { assignee: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/assignees/${p["assignee"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15214,9 +16639,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], @@ -15227,7 +16653,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15241,19 +16668,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15266,16 +16696,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15288,16 +16720,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15322,19 +16756,22 @@ export class ApiClient extends AbstractAxiosClient { | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15359,19 +16796,22 @@ export class ApiClient extends AbstractAxiosClient { | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15382,15 +16822,17 @@ export class ApiClient extends AbstractAxiosClient { issueNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15402,15 +16844,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15424,19 +16868,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/lock` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15447,15 +16894,17 @@ export class ApiClient extends AbstractAxiosClient { issueNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/lock` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15477,9 +16926,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -15490,7 +16940,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15512,19 +16963,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15536,15 +16990,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15557,16 +17013,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/timeline` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15578,16 +17036,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15602,19 +17062,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15625,15 +17088,17 @@ export class ApiClient extends AbstractAxiosClient { keyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15644,15 +17109,17 @@ export class ApiClient extends AbstractAxiosClient { keyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15664,16 +17131,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15688,19 +17157,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15711,15 +17183,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15735,19 +17209,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/labels/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15758,15 +17235,17 @@ export class ApiClient extends AbstractAxiosClient { name: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15776,15 +17255,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/languages` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15795,16 +17276,18 @@ export class ApiClient extends AbstractAxiosClient { ref?: t_code_scanning_ref }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/license` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15817,19 +17300,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/merge-upstream` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15844,19 +17330,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/merges` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15871,9 +17360,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/milestones` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], sort: p["sort"], @@ -15886,7 +17376,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15902,19 +17393,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/milestones` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15925,15 +17419,17 @@ export class ApiClient extends AbstractAxiosClient { milestoneNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15950,19 +17446,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15973,15 +17472,17 @@ export class ApiClient extends AbstractAxiosClient { milestoneNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15994,16 +17495,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16019,9 +17522,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/notifications` + const headers = this._headers({}, opts.headers) const query = this._query({ all: p["all"], participating: p["participating"], @@ -16035,7 +17539,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16048,7 +17553,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse<{ message?: string @@ -16057,16 +17562,19 @@ export class ApiClient extends AbstractAxiosClient { | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/notifications` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16076,15 +17584,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16101,19 +17611,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16136,19 +17649,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16158,15 +17674,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16178,16 +17696,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/builds` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16197,15 +17717,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/builds` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16215,15 +17737,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/builds/latest` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16234,15 +17758,17 @@ export class ApiClient extends AbstractAxiosClient { buildId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/builds/${p["buildId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16259,19 +17785,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/deployments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16282,15 +17811,17 @@ export class ApiClient extends AbstractAxiosClient { pagesDeploymentId: number | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/deployments/${p["pagesDeploymentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16301,15 +17832,17 @@ export class ApiClient extends AbstractAxiosClient { pagesDeploymentId: number | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/deployments/${p["pagesDeploymentId"]}/cancel` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16319,17 +17852,19 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/pages/health` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16339,19 +17874,21 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ enabled: boolean }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/private-vulnerability-reporting` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16361,15 +17898,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/private-vulnerability-reporting` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16379,15 +17918,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/private-vulnerability-reporting` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16400,9 +17941,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], @@ -16413,7 +17955,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16427,19 +17970,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/projects` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16449,15 +17995,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/properties/values` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16470,19 +18018,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/properties/values` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16499,9 +18050,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], head: p["head"], @@ -16516,7 +18068,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16536,19 +18089,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16563,9 +18119,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -16578,7 +18135,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16589,15 +18147,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16611,19 +18171,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16634,15 +18197,17 @@ export class ApiClient extends AbstractAxiosClient { commentId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16664,9 +18229,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -16677,7 +18243,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16699,19 +18266,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16723,15 +18293,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16742,15 +18314,17 @@ export class ApiClient extends AbstractAxiosClient { pullNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16768,19 +18342,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16803,19 +18380,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/codespaces` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16831,9 +18411,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -16846,7 +18427,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16869,19 +18451,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16896,19 +18481,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/comments/${p["commentId"]}/replies` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16921,16 +18509,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16943,16 +18533,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/files` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16963,15 +18555,17 @@ export class ApiClient extends AbstractAxiosClient { pullNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/merge` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16988,19 +18582,22 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/merge` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17011,15 +18608,17 @@ export class ApiClient extends AbstractAxiosClient { pullNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/requested_reviewers` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17034,19 +18633,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/requested_reviewers` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17061,19 +18663,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/requested_reviewers` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17086,16 +18691,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17120,19 +18727,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17144,15 +18754,17 @@ export class ApiClient extends AbstractAxiosClient { reviewId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17167,19 +18779,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17191,15 +18806,17 @@ export class ApiClient extends AbstractAxiosClient { reviewId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17213,16 +18830,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17238,19 +18857,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}/dismissals` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17266,19 +18888,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}/events` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17292,7 +18917,7 @@ export class ApiClient extends AbstractAxiosClient { } | null }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ message?: string @@ -17300,16 +18925,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/update-branch` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17320,16 +18948,18 @@ export class ApiClient extends AbstractAxiosClient { ref?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/readme` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17341,16 +18971,18 @@ export class ApiClient extends AbstractAxiosClient { ref?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/readme/${p["dir"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17362,16 +18994,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17392,19 +19026,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17415,15 +19052,17 @@ export class ApiClient extends AbstractAxiosClient { assetId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/assets/${p["assetId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17439,19 +19078,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/assets/${p["assetId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17462,15 +19104,17 @@ export class ApiClient extends AbstractAxiosClient { assetId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/assets/${p["assetId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17486,19 +19130,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/generate-notes` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17508,15 +19155,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/latest` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17527,15 +19176,17 @@ export class ApiClient extends AbstractAxiosClient { tag: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/tags/${p["tag"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17546,15 +19197,17 @@ export class ApiClient extends AbstractAxiosClient { releaseId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17575,19 +19228,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17598,15 +19254,17 @@ export class ApiClient extends AbstractAxiosClient { releaseId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17619,16 +19277,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/assets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17642,22 +19302,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/assets` - const headers = this._headers({ - "Content-Type": "application/octet-stream", - }) + const headers = this._headers( + { "Content-Type": "application/octet-stream" }, + opts.headers, + ) const query = this._query({ name: p["name"], label: p["label"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17671,9 +19332,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -17684,7 +19346,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17698,19 +19361,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17722,15 +19388,17 @@ export class ApiClient extends AbstractAxiosClient { reactionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17743,16 +19411,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rules/branches/${p["branch"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17765,9 +19435,10 @@ export class ApiClient extends AbstractAxiosClient { includesParents?: boolean }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -17778,7 +19449,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17796,19 +19468,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17824,9 +19499,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets/rule-suites` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], time_period: p["timePeriod"], @@ -17840,7 +19516,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17851,15 +19528,17 @@ export class ApiClient extends AbstractAxiosClient { ruleSuiteId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets/rule-suites/${p["ruleSuiteId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17871,16 +19550,18 @@ export class ApiClient extends AbstractAxiosClient { includesParents?: boolean }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ includes_parents: p["includesParents"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17899,19 +19580,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets/${p["rulesetId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17922,15 +19606,17 @@ export class ApiClient extends AbstractAxiosClient { rulesetId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17950,9 +19636,10 @@ export class ApiClient extends AbstractAxiosClient { validity?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], secret_type: p["secretType"], @@ -17970,7 +19657,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17981,15 +19669,17 @@ export class ApiClient extends AbstractAxiosClient { alertNumber: t_alert_number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts/${p["alertNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18005,19 +19695,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts/${p["alertNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18030,16 +19723,18 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts/${p["alertNumber"]}/locations` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18053,19 +19748,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/push-protection-bypasses` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18081,9 +19779,10 @@ export class ApiClient extends AbstractAxiosClient { state?: "triage" | "draft" | "published" | "closed" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], sort: p["sort"], @@ -18097,7 +19796,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18108,19 +19808,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_repository_advisory_create }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18131,19 +19834,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_private_vulnerability_report_create }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories/reports` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18154,15 +19860,17 @@ export class ApiClient extends AbstractAxiosClient { ghsaId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18174,19 +19882,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_repository_advisory_update }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18197,19 +19908,21 @@ export class ApiClient extends AbstractAxiosClient { ghsaId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}/cve` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18220,15 +19933,17 @@ export class ApiClient extends AbstractAxiosClient { ghsaId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}/forks` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18240,16 +19955,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/stargazers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18259,7 +19976,7 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse<{ @@ -18268,12 +19985,14 @@ export class ApiClient extends AbstractAxiosClient { | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/stats/code_frequency` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18283,7 +20002,7 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse<{ @@ -18292,12 +20011,14 @@ export class ApiClient extends AbstractAxiosClient { | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/stats/commit_activity` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18307,7 +20028,7 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse<{ @@ -18316,12 +20037,14 @@ export class ApiClient extends AbstractAxiosClient { | AxiosResponse > { const url = `/repos/${p["owner"]}/${p["repo"]}/stats/contributors` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18331,15 +20054,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/stats/participation` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18349,15 +20074,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/repos/${p["owner"]}/${p["repo"]}/stats/punch_card` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18374,19 +20101,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/statuses/${p["sha"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18398,16 +20128,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/subscribers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18417,15 +20149,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/subscription` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18439,19 +20173,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/subscription` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18461,15 +20198,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/subscription` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18481,16 +20220,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/tags` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18500,15 +20241,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/tags/protection` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18521,19 +20264,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/tags/protection` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18544,15 +20290,17 @@ export class ApiClient extends AbstractAxiosClient { tagProtectionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/tags/protection/${p["tagProtectionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18563,15 +20311,17 @@ export class ApiClient extends AbstractAxiosClient { ref: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/tarball/${p["ref"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18583,16 +20333,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18604,16 +20356,18 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/topics` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18626,19 +20380,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/topics` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18649,16 +20406,18 @@ export class ApiClient extends AbstractAxiosClient { per?: "day" | "week" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/traffic/clones` + const headers = this._headers({}, opts.headers) const query = this._query({ per: p["per"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18668,15 +20427,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/traffic/popular/paths` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18686,15 +20447,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/traffic/popular/referrers` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18705,16 +20468,18 @@ export class ApiClient extends AbstractAxiosClient { per?: "day" | "week" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/traffic/views` + const headers = this._headers({}, opts.headers) const query = this._query({ per: p["per"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18729,19 +20494,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/transfer` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18751,15 +20519,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/vulnerability-alerts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18769,15 +20539,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/vulnerability-alerts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18787,15 +20559,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/vulnerability-alerts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18806,15 +20580,17 @@ export class ApiClient extends AbstractAxiosClient { ref: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["owner"]}/${p["repo"]}/zipball/${p["ref"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18831,19 +20607,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repos/${p["templateOwner"]}/${p["templateRepo"]}/generate` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18852,16 +20631,18 @@ export class ApiClient extends AbstractAxiosClient { since?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18874,7 +20655,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -18883,6 +20664,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/code` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -18895,7 +20677,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18908,7 +20691,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -18917,6 +20700,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -18929,7 +20713,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18953,7 +20738,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -18962,6 +20747,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -18974,7 +20760,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18988,7 +20775,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -18997,6 +20784,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ repository_id: p["repositoryId"], q: p["q"], @@ -19010,7 +20798,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19023,7 +20812,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -19032,6 +20821,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19044,7 +20834,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19055,7 +20846,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -19064,6 +20855,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/topics` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], per_page: p["perPage"], @@ -19074,7 +20866,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19087,7 +20880,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ incomplete_results: boolean @@ -19096,6 +20889,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/search/users` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19108,7 +20902,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19117,15 +20912,17 @@ export class ApiClient extends AbstractAxiosClient { teamId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19144,19 +20941,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19165,15 +20965,17 @@ export class ApiClient extends AbstractAxiosClient { teamId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19185,9 +20987,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -19198,7 +21001,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19212,19 +21016,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19234,15 +21041,17 @@ export class ApiClient extends AbstractAxiosClient { discussionNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19256,19 +21065,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19278,15 +21090,17 @@ export class ApiClient extends AbstractAxiosClient { discussionNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19299,9 +21113,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -19312,7 +21127,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19325,19 +21141,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19348,15 +21167,17 @@ export class ApiClient extends AbstractAxiosClient { commentNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19370,19 +21191,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19393,15 +21217,17 @@ export class ApiClient extends AbstractAxiosClient { commentNumber: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19423,9 +21249,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -19436,7 +21263,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19458,19 +21286,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19491,9 +21322,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], @@ -19504,7 +21336,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19525,19 +21358,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19548,16 +21384,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19569,9 +21407,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/members` + const headers = this._headers({}, opts.headers) const query = this._query({ role: p["role"], per_page: p["perPage"], @@ -19582,7 +21421,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19592,15 +21432,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19610,15 +21452,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19628,15 +21472,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19646,15 +21492,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19667,19 +21515,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/memberships/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19689,15 +21540,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19708,16 +21561,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19727,15 +21582,17 @@ export class ApiClient extends AbstractAxiosClient { projectId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19748,19 +21605,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/projects/${p["projectId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19770,15 +21630,17 @@ export class ApiClient extends AbstractAxiosClient { projectId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19789,16 +21651,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19809,15 +21673,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/teams/${p["teamId"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19831,19 +21697,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/repos/${p["owner"]}/${p["repo"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19854,15 +21723,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19873,30 +21744,34 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/teams/${p["teamId"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async usersGetAuthenticated( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19914,19 +21789,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19936,16 +21814,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/blocks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19954,15 +21834,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19971,15 +21853,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19988,15 +21872,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20007,7 +21893,7 @@ export class ApiClient extends AbstractAxiosClient { repositoryId?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ codespaces: t_codespace[] @@ -20015,6 +21901,7 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/user/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -20025,7 +21912,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20060,19 +21948,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20082,7 +21973,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ secrets: t_codespaces_secret[] @@ -20090,27 +21981,31 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/user/codespaces/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async codespacesGetPublicKeyForAuthenticatedUser( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/secrets/public-key` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20119,15 +22014,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20141,19 +22038,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise | AxiosResponse> { const url = `/user/codespaces/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20162,15 +22062,17 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20179,7 +22081,7 @@ export class ApiClient extends AbstractAxiosClient { secretName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_minimal_repository[] @@ -20187,12 +22089,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/user/codespaces/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20204,19 +22108,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20226,15 +22133,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20244,15 +22153,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20261,15 +22172,17 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20283,19 +22196,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20304,19 +22220,21 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ [key: string]: unknown | undefined }> > { const url = `/user/codespaces/${p["codespaceName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20325,15 +22243,17 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}/exports` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20343,15 +22263,17 @@ export class ApiClient extends AbstractAxiosClient { exportId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}/exports/${p["exportId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20360,7 +22282,7 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ machines: t_codespace_machine[] @@ -20368,12 +22290,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/user/codespaces/${p["codespaceName"]}/machines` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20386,19 +22310,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}/publish` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20407,15 +22334,17 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}/start` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20424,29 +22353,33 @@ export class ApiClient extends AbstractAxiosClient { codespaceName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/codespaces/${p["codespaceName"]}/stop` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async packagesListDockerMigrationConflictingPackagesForAuthenticatedUser( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/docker/conflicts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20457,19 +22390,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/email/visibility` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20479,16 +22415,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/emails` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20502,19 +22440,22 @@ export class ApiClient extends AbstractAxiosClient { | string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/emails` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20528,19 +22469,22 @@ export class ApiClient extends AbstractAxiosClient { | string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/emails` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20550,16 +22494,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/followers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20569,16 +22515,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/following` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20587,15 +22535,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/following/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20604,15 +22554,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/following/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20621,15 +22573,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/following/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20639,16 +22593,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/gpg_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20660,19 +22616,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/gpg_keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20681,15 +22640,17 @@ export class ApiClient extends AbstractAxiosClient { gpgKeyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/gpg_keys/${p["gpgKeyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20698,15 +22659,17 @@ export class ApiClient extends AbstractAxiosClient { gpgKeyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/gpg_keys/${p["gpgKeyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20716,7 +22679,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ installations: t_installation[] @@ -20724,13 +22687,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/user/installations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20741,7 +22706,7 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ repositories: t_repository[] @@ -20750,13 +22715,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/user/installations/${p["installationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20766,15 +22733,17 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/installations/${p["installationId"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20784,32 +22753,36 @@ export class ApiClient extends AbstractAxiosClient { repositoryId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/installations/${p["installationId"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async interactionsGetRestrictionsForAuthenticatedUser( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse | AxiosResponse > { const url = `/user/interaction-limits` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20818,33 +22791,38 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_interaction_limit }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/interaction-limits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async interactionsRemoveRestrictionsForAuthenticatedUser( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/interaction-limits` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20866,9 +22844,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], state: p["state"], @@ -20884,7 +22863,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20894,16 +22874,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20915,19 +22897,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20936,15 +22921,17 @@ export class ApiClient extends AbstractAxiosClient { keyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20953,15 +22940,17 @@ export class ApiClient extends AbstractAxiosClient { keyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20971,16 +22960,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/marketplace_purchases` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20990,16 +22981,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/marketplace_purchases/stubbed` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21010,9 +23003,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/memberships/orgs` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], @@ -21023,7 +23017,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21032,15 +23027,17 @@ export class ApiClient extends AbstractAxiosClient { org: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/memberships/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21052,19 +23049,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/memberships/orgs/${p["org"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21074,16 +23074,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21102,19 +23104,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21124,16 +23129,18 @@ export class ApiClient extends AbstractAxiosClient { exclude?: string[] }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations/${p["migrationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude: p["exclude"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21142,15 +23149,17 @@ export class ApiClient extends AbstractAxiosClient { migrationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21159,15 +23168,17 @@ export class ApiClient extends AbstractAxiosClient { migrationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21177,15 +23188,17 @@ export class ApiClient extends AbstractAxiosClient { repoName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations/${p["migrationId"]}/repos/${p["repoName"]}/lock` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21196,16 +23209,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/migrations/${p["migrationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21215,16 +23230,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/orgs` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21242,9 +23259,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages` + const headers = this._headers({}, opts.headers) const query = this._query({ package_type: p["packageType"], visibility: p["visibility"], @@ -21256,7 +23274,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21272,15 +23291,17 @@ export class ApiClient extends AbstractAxiosClient { packageName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21296,15 +23317,17 @@ export class ApiClient extends AbstractAxiosClient { packageName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21321,16 +23344,18 @@ export class ApiClient extends AbstractAxiosClient { token?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}/restore` + const headers = this._headers({}, opts.headers) const query = this._query({ token: p["token"] }) return this._request({ url: url + query, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21349,9 +23374,10 @@ export class ApiClient extends AbstractAxiosClient { state?: "active" | "deleted" }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}/versions` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"], @@ -21362,7 +23388,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21379,15 +23406,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21404,15 +23433,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21429,15 +23460,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}/restore` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21449,19 +23482,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/projects` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21471,16 +23507,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/public_emails` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21497,9 +23535,10 @@ export class ApiClient extends AbstractAxiosClient { before?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ visibility: p["visibility"], affiliation: p["affiliation"], @@ -21516,7 +23555,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21549,19 +23589,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/repos` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21571,16 +23614,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/repository_invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21589,15 +23634,17 @@ export class ApiClient extends AbstractAxiosClient { invitationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/repository_invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PATCH", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21606,15 +23653,17 @@ export class ApiClient extends AbstractAxiosClient { invitationId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/repository_invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21624,16 +23673,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/social_accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21644,19 +23695,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/social_accounts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21667,19 +23721,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/social_accounts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21689,16 +23746,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/ssh_signing_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21710,19 +23769,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/ssh_signing_keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21731,15 +23793,17 @@ export class ApiClient extends AbstractAxiosClient { sshSigningKeyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/ssh_signing_keys/${p["sshSigningKeyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21748,15 +23812,17 @@ export class ApiClient extends AbstractAxiosClient { sshSigningKeyId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/ssh_signing_keys/${p["sshSigningKeyId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21768,9 +23834,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/starred` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -21782,7 +23849,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21792,15 +23860,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/starred/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21810,15 +23880,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/starred/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "PUT", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21828,15 +23900,17 @@ export class ApiClient extends AbstractAxiosClient { repo: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/starred/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21846,16 +23920,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/subscriptions` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21865,16 +23941,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21883,15 +23961,17 @@ export class ApiClient extends AbstractAxiosClient { accountId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/user/${p["accountId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21901,16 +23981,18 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21919,15 +24001,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21940,7 +24024,7 @@ export class ApiClient extends AbstractAxiosClient { subjectDigest: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< | AxiosResponse<{ attestations?: { @@ -21952,6 +24036,7 @@ export class ApiClient extends AbstractAxiosClient { | AxiosResponse > { const url = `/users/${p["username"]}/attestations/${p["subjectDigest"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], @@ -21962,7 +24047,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21971,15 +24057,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/docker/conflicts` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21990,16 +24078,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22011,16 +24101,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/events/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22031,16 +24123,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/events/public` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22051,16 +24145,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/followers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22071,16 +24167,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/following` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22090,15 +24188,17 @@ export class ApiClient extends AbstractAxiosClient { targetUser: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/following/${p["targetUser"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22110,9 +24210,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/gists` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], @@ -22123,7 +24224,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22134,16 +24236,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/gpg_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22154,9 +24258,10 @@ export class ApiClient extends AbstractAxiosClient { subjectId?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/hovercard` + const headers = this._headers({}, opts.headers) const query = this._query({ subject_type: p["subjectType"], subject_id: p["subjectId"], @@ -22166,7 +24271,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22175,15 +24281,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/installation` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22194,16 +24302,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22214,16 +24324,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/orgs` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22242,9 +24354,10 @@ export class ApiClient extends AbstractAxiosClient { perPage?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages` + const headers = this._headers({}, opts.headers) const query = this._query({ package_type: p["packageType"], visibility: p["visibility"], @@ -22256,7 +24369,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22273,15 +24387,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22298,15 +24414,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22324,16 +24442,18 @@ export class ApiClient extends AbstractAxiosClient { token?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/restore` + const headers = this._headers({}, opts.headers) const query = this._query({ token: p["token"] }) return this._request({ url: url + query, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22350,15 +24470,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22376,15 +24498,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22402,15 +24526,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22428,15 +24554,17 @@ export class ApiClient extends AbstractAxiosClient { packageVersionId: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}/restore` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22448,9 +24576,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], @@ -22461,7 +24590,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22472,16 +24602,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/received_events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22492,16 +24624,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/received_events/public` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22515,9 +24649,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ type: p["type"], sort: p["sort"], @@ -22530,7 +24665,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22539,15 +24675,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/settings/billing/actions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22556,15 +24694,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/settings/billing/packages` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22573,15 +24713,17 @@ export class ApiClient extends AbstractAxiosClient { username: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/settings/billing/shared-storage` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22592,16 +24734,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/social_accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22612,16 +24756,18 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/ssh_signing_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22634,9 +24780,10 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/starred` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -22648,7 +24795,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22659,44 +24807,50 @@ export class ApiClient extends AbstractAxiosClient { page?: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/users/${p["username"]}/subscriptions` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async metaGetAllVersions( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/versions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async metaGetZen( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/zen` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/azure-core-data-plane-service.tsp/client.ts b/integration-tests/typescript-axios/src/generated/azure-core-data-plane-service.tsp/client.ts index d7d0f926..b6e522ed 100644 --- a/integration-tests/typescript-axios/src/generated/azure-core-data-plane-service.tsp/client.ts +++ b/integration-tests/typescript-axios/src/generated/azure-core-data-plane-service.tsp/client.ts @@ -36,24 +36,25 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ statusString: string }> > { const url = `/service-status` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -64,7 +65,7 @@ export class ApiClient extends AbstractAxiosClient { operationId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse< | { @@ -81,13 +82,15 @@ export class ApiClient extends AbstractAxiosClient { > > { const url = `/widgets/${p["widgetName"]}/operations/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -105,29 +108,32 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_WidgetCreateOrUpdate }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}` - const headers = this._headers({ - "Content-Type": "application/merge-patch+json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/merge-patch+json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -142,24 +148,27 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -176,7 +185,7 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -185,23 +194,26 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/widgets/${p["widgetName"]}` - const headers = this._headers({ - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "DELETE", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -215,12 +227,13 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"], top: p["top"], @@ -232,9 +245,9 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -249,24 +262,27 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}/analytics/current` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -284,29 +300,32 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_WidgetAnalyticsCreateOrUpdate }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}/analytics/current` - const headers = this._headers({ - "Content-Type": "application/merge-patch+json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/merge-patch+json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -317,7 +336,7 @@ export class ApiClient extends AbstractAxiosClient { operationId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -327,13 +346,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/widgets/${p["widgetId"]}/repairs/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -347,7 +368,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_WidgetRepairRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -363,22 +384,25 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/widgets/${p["widgetName"]}:scheduleRepairs` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -390,7 +414,7 @@ export class ApiClient extends AbstractAxiosClient { operationId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -400,13 +424,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/widgets/${p["widgetName"]}/parts/${p["widgetPartName"]}/operations/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -424,29 +450,32 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_WidgetPart }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}/parts` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -457,20 +486,21 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}/parts` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -486,24 +516,27 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}/parts/${p["widgetPartName"]}` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -521,26 +554,29 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/widgets/${p["widgetName"]}/parts/${p["widgetPartName"]}` - const headers = this._headers({ - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "DELETE", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -554,7 +590,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_WidgetPartReorderRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -563,22 +599,25 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/widgets/${p["widgetName"]}/parts:reorderParts` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -589,7 +628,7 @@ export class ApiClient extends AbstractAxiosClient { operationId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -599,13 +638,15 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/manufacturers/${p["manufacturerId"]}/operations/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -623,29 +664,32 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_Manufacturer }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/manufacturers/${p["manufacturerId"]}` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -660,24 +704,27 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/manufacturers/${p["manufacturerId"]}` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -694,7 +741,7 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ error?: t_Azure_Core_Foundations_Error @@ -703,23 +750,26 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/manufacturers/${p["manufacturerId"]}` - const headers = this._headers({ - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "DELETE", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -729,20 +779,21 @@ export class ApiClient extends AbstractAxiosClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/manufacturers` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/azure-resource-manager.tsp/client.ts b/integration-tests/typescript-axios/src/generated/azure-resource-manager.tsp/client.ts index 85cb73c5..694537f1 100644 --- a/integration-tests/typescript-axios/src/generated/azure-resource-manager.tsp/client.ts +++ b/integration-tests/typescript-axios/src/generated/azure-resource-manager.tsp/client.ts @@ -27,16 +27,18 @@ export class ApiClient extends AbstractAxiosClient { apiVersion: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/providers/Microsoft.ContosoProviderHub/operations` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -48,16 +50,18 @@ export class ApiClient extends AbstractAxiosClient { employeeName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -70,20 +74,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_Employee }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -96,20 +103,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_EmployeeUpdate }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -121,16 +131,18 @@ export class ApiClient extends AbstractAxiosClient { employeeName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -141,16 +153,18 @@ export class ApiClient extends AbstractAxiosClient { resourceGroupName: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -160,16 +174,18 @@ export class ApiClient extends AbstractAxiosClient { subscriptionId: t_Azure_Core_uuid }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/providers/Microsoft.ContosoProviderHub/employees` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -182,20 +198,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_MoveRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}/move` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/okta.idp.yaml/client.ts b/integration-tests/typescript-axios/src/generated/okta.idp.yaml/client.ts index 15e80276..bcd361ca 100644 --- a/integration-tests/typescript-axios/src/generated/okta.idp.yaml/client.ts +++ b/integration-tests/typescript-axios/src/generated/okta.idp.yaml/client.ts @@ -35,21 +35,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_AppAuthenticatorEnrollmentRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/app-authenticators` - const headers = this._headers({ - "Content-Type": "application/json, okta-version=1.0.0", - }) + const headers = this._headers( + { "Content-Type": "application/json, okta-version=1.0.0" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -59,21 +60,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_PushNotificationVerification }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/app-authenticators/challenge/${p["challengeId"]}/verify` - const headers = this._headers({ - "Content-Type": "application/json;okta-version=1.0.0", - }) + const headers = this._headers( + { "Content-Type": "application/json;okta-version=1.0.0" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -83,21 +85,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_UpdateAppAuthenticatorEnrollmentRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/app-authenticators/${p["enrollmentId"]}` - const headers = this._headers({ - "Content-Type": "application/merge-patch+json;okta-version=1.0.0", - }) + const headers = this._headers( + { "Content-Type": "application/merge-patch+json;okta-version=1.0.0" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PATCH", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -106,15 +109,17 @@ export class ApiClient extends AbstractAxiosClient { enrollmentId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/app-authenticators/${p["enrollmentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -123,15 +128,17 @@ export class ApiClient extends AbstractAxiosClient { enrollmentId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/app-authenticators/${p["enrollmentId"]}/push/notifications` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -140,16 +147,18 @@ export class ApiClient extends AbstractAxiosClient { expand?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/authenticators` + const headers = this._headers({}, opts.headers) const query = this._query({ expand: p["expand"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -159,16 +168,18 @@ export class ApiClient extends AbstractAxiosClient { expand?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/authenticators/${p["authenticatorId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ expand: p["expand"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -177,15 +188,17 @@ export class ApiClient extends AbstractAxiosClient { authenticatorId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/authenticators/${p["authenticatorId"]}/enrollments` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -195,29 +208,33 @@ export class ApiClient extends AbstractAxiosClient { enrollmentId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/authenticators/${p["authenticatorId"]}/enrollments/${p["enrollmentId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async listEmails( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/emails` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -233,19 +250,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/emails` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -254,15 +274,17 @@ export class ApiClient extends AbstractAxiosClient { id: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/emails/${p["id"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -271,15 +293,17 @@ export class ApiClient extends AbstractAxiosClient { id: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/emails/${p["id"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -291,7 +315,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ _links: { @@ -317,16 +341,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/idp/myaccount/emails/${p["id"]}/challenge` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -336,7 +363,7 @@ export class ApiClient extends AbstractAxiosClient { challengeId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ _links: { @@ -362,12 +389,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/idp/myaccount/emails/${p["id"]}/challenge/${p["challengeId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -380,61 +409,70 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/emails/${p["id"]}/challenge/${p["challengeId"]}/verify` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async listOktaApplications( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/okta-applications` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async getOrganization( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/organization` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async getPassword( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/password` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -447,19 +485,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/password` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -472,47 +513,54 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/password` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async deletePassword( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/password` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async listPhones( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/phones` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -527,19 +575,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/phones` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -548,15 +599,17 @@ export class ApiClient extends AbstractAxiosClient { id: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/phones/${p["id"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -565,15 +618,17 @@ export class ApiClient extends AbstractAxiosClient { id: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/phones/${p["id"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -586,7 +641,7 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ _links?: { @@ -600,16 +655,19 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/idp/myaccount/phones/${p["id"]}/challenge` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -621,33 +679,38 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/phones/${p["id"]}/verify` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async getProfile( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/profile` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -658,47 +721,54 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/profile` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async getProfileSchema( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/profile/schema` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async deleteSessions( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/idp/myaccount/sessions` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/okta.oauth.yaml/client.ts b/integration-tests/typescript-axios/src/generated/okta.oauth.yaml/client.ts index beb2f4f6..60b368ce 100644 --- a/integration-tests/typescript-axios/src/generated/okta.oauth.yaml/client.ts +++ b/integration-tests/typescript-axios/src/generated/okta.oauth.yaml/client.ts @@ -48,16 +48,18 @@ export class ApiClient extends AbstractAxiosClient { clientId?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/.well-known/openid-configuration` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -85,9 +87,10 @@ export class ApiClient extends AbstractAxiosClient { state?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/authorize` + const headers = this._headers({}, opts.headers) const query = this._query({ acr_values: p["acrValues"], client_id: p["clientId"], @@ -115,7 +118,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -124,21 +128,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_BackchannelAuthorizeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/bc/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -147,21 +152,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_ChallengeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/challenge` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -172,9 +178,10 @@ export class ApiClient extends AbstractAxiosClient { q?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/clients` + const headers = this._headers({}, opts.headers) const query = this._query({ after: p["after"], limit: p["limit"], @@ -185,7 +192,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -194,19 +202,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_Client }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/clients` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -215,15 +226,17 @@ export class ApiClient extends AbstractAxiosClient { clientId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/clients/${p["clientId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -233,19 +246,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_Client }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/clients/${p["clientId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -254,15 +270,17 @@ export class ApiClient extends AbstractAxiosClient { clientId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/clients/${p["clientId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -271,15 +289,17 @@ export class ApiClient extends AbstractAxiosClient { clientId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/clients/${p["clientId"]}/lifecycle/newSecret` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "POST", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -288,21 +308,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_DeviceAuthorizeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/device/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -311,19 +332,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_GlobalTokenRevocationRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/global-token-revocation` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -332,19 +356,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_IntrospectionRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/introspect` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -353,16 +380,18 @@ export class ApiClient extends AbstractAxiosClient { clientId?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -373,9 +402,10 @@ export class ApiClient extends AbstractAxiosClient { state?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/logout` + const headers = this._headers({}, opts.headers) const query = this._query({ id_token_hint: p["idTokenHint"], post_logout_redirect_uri: p["postLogoutRedirectUri"], @@ -386,7 +416,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -395,21 +426,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_LogoutWithPost }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/logout` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -418,21 +450,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_OobAuthenticateRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/oob-authenticate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -441,17 +474,17 @@ export class ApiClient extends AbstractAxiosClient { origin?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/par` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) return this._request({ url: url, method: "OPTIONS", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -460,19 +493,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_ParRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/par` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -481,19 +517,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_RevokeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/revoke` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -502,17 +541,17 @@ export class ApiClient extends AbstractAxiosClient { origin?: string } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/token` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) return this._request({ url: url, method: "OPTIONS", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -521,35 +560,38 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_TokenRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/token` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } async userinfo( timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/v1/userinfo` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -559,16 +601,18 @@ export class ApiClient extends AbstractAxiosClient { clientId?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/.well-known/oauth-authorization-server` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -578,16 +622,18 @@ export class ApiClient extends AbstractAxiosClient { clientId?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/.well-known/openid-configuration` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -616,9 +662,10 @@ export class ApiClient extends AbstractAxiosClient { state?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/authorize` + const headers = this._headers({}, opts.headers) const query = this._query({ acr_values: p["acrValues"], client_id: p["clientId"], @@ -646,7 +693,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -656,21 +704,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_BackchannelAuthorizeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/bc/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -680,21 +729,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_ChallengeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/challenge` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -704,21 +754,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_DeviceAuthorizeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/device/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -728,19 +779,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_IntrospectionRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/introspect` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -749,15 +803,17 @@ export class ApiClient extends AbstractAxiosClient { authorizationServerId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/keys` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -769,9 +825,10 @@ export class ApiClient extends AbstractAxiosClient { state?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/logout` + const headers = this._headers({}, opts.headers) const query = this._query({ id_token_hint: p["idTokenHint"], post_logout_redirect_uri: p["postLogoutRedirectUri"], @@ -782,7 +839,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -792,21 +850,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_LogoutWithPost }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/logout` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -816,21 +875,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_OobAuthenticateRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/oob-authenticate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -840,17 +900,17 @@ export class ApiClient extends AbstractAxiosClient { origin?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/par` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) return this._request({ url: url, method: "OPTIONS", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -860,19 +920,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_ParRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/par` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -882,19 +945,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_RevokeRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/revoke` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -904,17 +970,17 @@ export class ApiClient extends AbstractAxiosClient { origin?: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/token` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) return this._request({ url: url, method: "OPTIONS", - headers, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -924,21 +990,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_TokenRequest }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/token` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -947,15 +1014,17 @@ export class ApiClient extends AbstractAxiosClient { authorizationServerId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/oauth2/${p["authorizationServerId"]}/v1/userinfo` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/petstore-expanded.yaml/client.ts b/integration-tests/typescript-axios/src/generated/petstore-expanded.yaml/client.ts index b849ef8c..b668d730 100644 --- a/integration-tests/typescript-axios/src/generated/petstore-expanded.yaml/client.ts +++ b/integration-tests/typescript-axios/src/generated/petstore-expanded.yaml/client.ts @@ -20,16 +20,18 @@ export class ApiClient extends AbstractAxiosClient { limit?: number } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/pets` + const headers = this._headers({}, opts.headers) const query = this._query({ tags: p["tags"], limit: p["limit"] }) return this._request({ url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -38,19 +40,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_NewPet }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/pets` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -59,15 +64,17 @@ export class ApiClient extends AbstractAxiosClient { id: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/pets/${p["id"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -76,15 +83,17 @@ export class ApiClient extends AbstractAxiosClient { id: number }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/pets/${p["id"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/stripe.yaml/client.ts b/integration-tests/typescript-axios/src/generated/stripe.yaml/client.ts index 8b577865..6b054420 100644 --- a/integration-tests/typescript-axios/src/generated/stripe.yaml/client.ts +++ b/integration-tests/typescript-axios/src/generated/stripe.yaml/client.ts @@ -174,22 +174,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/account` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -209,21 +210,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/account_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -307,21 +309,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/account_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -342,7 +345,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_account[] @@ -352,9 +355,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -367,10 +371,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -838,21 +842,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -862,21 +867,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -887,22 +893,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1343,21 +1350,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1391,21 +1399,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/bank_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1416,21 +1425,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1442,22 +1452,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1493,21 +1504,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1518,7 +1530,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_capability[] @@ -1528,19 +1540,20 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/accounts/${p["account"]}/capabilities` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1552,22 +1565,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/capabilities/${p["capability"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1581,21 +1595,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/capabilities/${p["capability"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1610,7 +1625,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: (t_bank_account | t_card)[] @@ -1620,9 +1635,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/accounts/${p["account"]}/external_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -1635,10 +1651,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1672,21 +1688,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/external_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1697,21 +1714,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/external_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1723,22 +1741,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/external_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1774,21 +1793,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/external_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1800,21 +1820,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/login_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1835,7 +1856,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_person[] @@ -1845,9 +1866,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/accounts/${p["account"]}/people` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -1860,10 +1882,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -1975,21 +1997,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/people` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2000,21 +2023,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/people/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2026,22 +2050,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/people/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2154,21 +2179,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/people/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2189,7 +2215,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_person[] @@ -2199,9 +2225,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/accounts/${p["account"]}/persons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -2214,10 +2241,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2329,21 +2356,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/persons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2354,21 +2382,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/persons/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2380,22 +2409,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/persons/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2508,21 +2538,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/persons/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2535,21 +2566,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/accounts/${p["account"]}/reject` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2563,7 +2595,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_apple_pay_domain[] @@ -2573,9 +2605,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/apple_pay/domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ domain_name: p["domainName"], ending_before: p["endingBefore"], @@ -2588,10 +2621,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2603,21 +2636,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/apple_pay/domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2627,21 +2661,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/apple_pay/domains/${p["domain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2652,22 +2687,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/apple_pay/domains/${p["domain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2689,7 +2725,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_application_fee[] @@ -2699,9 +2735,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/application_fees` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -2715,10 +2752,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2730,22 +2767,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/application_fees/${p["fee"]}/refunds/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2763,21 +2801,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/application_fees/${p["fee"]}/refunds/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2788,22 +2827,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/application_fees/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2817,21 +2857,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/application_fees/${p["id"]}/refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2845,7 +2886,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_fee_refund[] @@ -2855,9 +2896,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/application_fees/${p["id"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -2869,10 +2911,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2888,21 +2930,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/application_fees/${p["id"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2919,7 +2962,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_apps_secret[] @@ -2929,9 +2972,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/apps/secrets` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -2944,10 +2988,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2965,21 +3009,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/apps/secrets` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -2995,21 +3040,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/apps/secrets/delete` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3024,12 +3070,13 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/apps/secrets/find` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], name: p["name"], @@ -3040,10 +3087,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3053,22 +3100,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3093,7 +3141,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_balance_transaction[] @@ -3103,9 +3151,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/balance/history` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], currency: p["currency"], @@ -3122,10 +3171,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3136,22 +3185,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/balance/history/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3176,7 +3226,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_balance_transaction[] @@ -3186,9 +3236,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], currency: p["currency"], @@ -3205,10 +3256,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3219,22 +3270,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/balance_transactions/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3249,7 +3301,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_billing_alert[] @@ -3259,9 +3311,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/billing/alerts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ alert_type: p["alertType"], ending_before: p["endingBefore"], @@ -3275,10 +3328,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3299,21 +3352,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/alerts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3324,22 +3378,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/alerts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3351,21 +3406,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/alerts/${p["id"]}/activate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3377,21 +3433,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/alerts/${p["id"]}/archive` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3403,21 +3460,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/alerts/${p["id"]}/deactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3433,21 +3491,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meter_event_adjustments` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3464,21 +3523,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meter_events` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3492,7 +3552,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_billing_meter[] @@ -3502,9 +3562,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/billing/meters` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -3517,10 +3578,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3544,21 +3605,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meters` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3569,22 +3631,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meters/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3597,21 +3660,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meters/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3623,21 +3687,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meters/${p["id"]}/deactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3655,7 +3720,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_billing_meter_event_summary[] @@ -3665,9 +3730,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/billing/meters/${p["id"]}/event_summaries` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], end_time: p["endTime"], @@ -3683,10 +3749,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3698,21 +3764,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing/meters/${p["id"]}/reactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3727,7 +3794,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_billing_portal_configuration[] @@ -3737,9 +3804,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/billing_portal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], ending_before: p["endingBefore"], @@ -3753,10 +3821,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3833,21 +3901,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing_portal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3858,22 +3927,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing_portal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -3954,21 +4024,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing_portal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4071,21 +4142,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/billing_portal/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4109,7 +4181,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_charge[] @@ -4119,9 +4191,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/charges` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -4137,10 +4210,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4215,21 +4288,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4242,7 +4316,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_charge[] @@ -4254,9 +4328,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/charges/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -4268,10 +4343,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4282,22 +4357,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4335,21 +4411,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4371,21 +4448,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4396,22 +4474,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/dispute` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4458,21 +4537,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/dispute` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4484,21 +4564,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/dispute/close` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4521,21 +4602,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4549,7 +4631,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_refund[] @@ -4559,9 +4641,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/charges/${p["charge"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -4573,10 +4656,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4602,21 +4685,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4628,22 +4712,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4661,21 +4746,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/charges/${p["charge"]}/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -4704,7 +4790,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_checkout_session[] @@ -4714,9 +4800,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/checkout/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -4735,10 +4822,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5520,21 +5607,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/checkout/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5545,22 +5633,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/checkout/sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5577,21 +5666,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/checkout/sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5603,21 +5693,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/checkout/sessions/${p["session"]}/expire` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5631,7 +5722,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_item[] @@ -5641,9 +5732,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/checkout/sessions/${p["session"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5655,10 +5747,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5671,7 +5763,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_climate_order[] @@ -5681,9 +5773,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/climate/orders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5695,10 +5788,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5719,21 +5812,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/climate/orders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5744,22 +5838,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/climate/orders/${p["order"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5779,21 +5874,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/climate/orders/${p["order"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5805,21 +5901,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/climate/orders/${p["order"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5832,7 +5929,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_climate_product[] @@ -5842,9 +5939,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/climate/products` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5856,10 +5954,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5870,22 +5968,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/climate/products/${p["product"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5898,7 +5997,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_climate_supplier[] @@ -5908,9 +6007,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/climate/suppliers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5922,10 +6022,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5936,22 +6036,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/climate/suppliers/${p["supplier"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5962,22 +6063,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/confirmation_tokens/${p["confirmationToken"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -5990,7 +6092,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_country_spec[] @@ -6000,9 +6102,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/country_specs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -6014,10 +6117,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6028,22 +6131,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/country_specs/${p["country"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6064,7 +6168,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_coupon[] @@ -6074,9 +6178,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/coupons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -6089,10 +6194,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6127,21 +6232,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/coupons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6151,21 +6257,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/coupons/${p["coupon"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6176,22 +6283,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/coupons/${p["coupon"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6216,21 +6324,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/coupons/${p["coupon"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6253,7 +6362,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_credit_note[] @@ -6263,9 +6372,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/credit_notes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -6280,10 +6390,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6331,21 +6441,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/credit_notes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6392,12 +6503,13 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/credit_notes/preview` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ amount: p["amount"], credit_amount: p["creditAmount"], @@ -6419,10 +6531,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6472,7 +6584,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_credit_note_line_item[] @@ -6482,9 +6594,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/credit_notes/preview/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ amount: p["amount"], credit_amount: p["creditAmount"], @@ -6509,10 +6622,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6526,7 +6639,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_credit_note_line_item[] @@ -6536,9 +6649,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/credit_notes/${p["creditNote"]}/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -6550,10 +6664,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6564,22 +6678,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/credit_notes/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6595,21 +6710,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/credit_notes/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6621,21 +6737,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/credit_notes/${p["id"]}/void` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6670,21 +6787,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customer_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6707,7 +6825,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_customer[] @@ -6717,9 +6835,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], email: p["email"], @@ -6734,10 +6853,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6895,21 +7014,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6922,7 +7042,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_customer[] @@ -6934,9 +7054,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -6948,10 +7069,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6961,21 +7082,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -6986,22 +7108,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7115,21 +7238,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7143,7 +7267,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_customer_balance_transaction[] @@ -7153,9 +7277,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7167,10 +7292,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7190,21 +7315,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7216,22 +7342,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/balance_transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7250,21 +7377,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/balance_transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7278,7 +7406,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_bank_account[] @@ -7288,9 +7416,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/bank_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7302,10 +7431,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7352,21 +7481,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/bank_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7379,21 +7509,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7405,22 +7536,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7462,21 +7594,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7490,21 +7623,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}/verify` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7518,7 +7652,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_card[] @@ -7528,9 +7662,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7542,10 +7677,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7592,21 +7727,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7619,21 +7755,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cards/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7645,22 +7782,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cards/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7702,21 +7840,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cards/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7727,22 +7866,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cash_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7757,21 +7897,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cash_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7785,7 +7926,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_customer_cash_balance_transaction[] @@ -7795,9 +7936,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/cash_balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7809,10 +7951,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7824,22 +7966,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/cash_balance_transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7849,21 +7992,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7874,22 +8018,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7915,21 +8060,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/funding_instructions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -7982,7 +8128,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_method[] @@ -7992,9 +8138,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/payment_methods` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ allow_redisplay: p["allowRedisplay"], ending_before: p["endingBefore"], @@ -8008,10 +8155,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8023,22 +8170,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/payment_methods/${p["paymentMethod"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8053,7 +8201,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: (t_bank_account | t_card | t_source)[] @@ -8063,9 +8211,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/sources` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -8078,10 +8227,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8128,21 +8277,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/sources` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8155,21 +8305,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/sources/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8181,22 +8332,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/sources/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8238,21 +8390,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/sources/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8266,21 +8419,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/sources/${p["id"]}/verify` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8294,7 +8448,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_subscription[] @@ -8304,9 +8458,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -8318,10 +8473,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8561,21 +8716,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8590,21 +8746,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8616,22 +8773,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8896,21 +9054,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8921,21 +9080,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8947,22 +9107,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -8976,7 +9137,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_id[] @@ -8986,9 +9147,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/customers/${p["customer"]}/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -9000,10 +9162,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9090,21 +9252,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9115,21 +9278,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9141,22 +9305,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/customers/${p["customer"]}/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9179,7 +9344,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_dispute[] @@ -9189,9 +9354,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/disputes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -9206,10 +9372,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9220,22 +9386,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9282,21 +9449,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9308,21 +9476,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/disputes/${p["dispute"]}/close` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9336,7 +9505,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_entitlements_active_entitlement[] @@ -9346,9 +9515,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/entitlements/active_entitlements` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], ending_before: p["endingBefore"], @@ -9361,10 +9531,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9375,22 +9545,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/entitlements/active_entitlements/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9405,7 +9576,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_entitlements_feature[] @@ -9415,9 +9586,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/entitlements/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ archived: p["archived"], ending_before: p["endingBefore"], @@ -9431,10 +9603,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9450,21 +9622,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/entitlements/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9475,22 +9648,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/entitlements/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9509,21 +9683,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/entitlements/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9538,21 +9713,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/ephemeral_keys` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9564,21 +9740,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/ephemeral_keys/${p["key"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9602,7 +9779,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_event[] @@ -9612,9 +9789,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/events` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], delivery_success: p["deliverySuccess"], @@ -9630,10 +9808,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9644,22 +9822,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/events/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9672,7 +9851,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_exchange_rate[] @@ -9682,9 +9861,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/exchange_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -9696,10 +9876,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9710,22 +9890,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/exchange_rates/${p["rateId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9748,7 +9929,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_file_link[] @@ -9758,9 +9939,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/file_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -9775,10 +9957,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9796,21 +9978,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/file_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9821,22 +10004,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/file_links/${p["link"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9854,21 +10038,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/file_links/${p["link"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9905,7 +10090,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_file[] @@ -9915,9 +10100,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/files` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -9931,10 +10117,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9966,19 +10152,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/files` - const headers = this._headers({ "Content-Type": "multipart/form-data" }) + const headers = this._headers( + { "Content-Type": "multipart/form-data" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -9989,22 +10178,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/files/${p["file"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10022,7 +10212,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_financial_connections_account[] @@ -10032,9 +10222,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/financial_connections/accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ account_holder: p["accountHolder"], ending_before: p["endingBefore"], @@ -10048,10 +10239,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10062,22 +10253,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10089,21 +10281,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/accounts/${p["account"]}/disconnect` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10118,7 +10311,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_financial_connections_account_owner[] @@ -10128,9 +10321,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/financial_connections/accounts/${p["account"]}/owners` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -10143,10 +10337,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10159,21 +10353,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/accounts/${p["account"]}/refresh` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10186,21 +10381,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/accounts/${p["account"]}/subscribe` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10213,21 +10409,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/accounts/${p["account"]}/unsubscribe` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10261,21 +10458,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10286,22 +10484,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10326,7 +10525,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_financial_connections_transaction[] @@ -10336,9 +10535,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/financial_connections/transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ account: p["account"], ending_before: p["endingBefore"], @@ -10353,10 +10553,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10367,22 +10567,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/financial_connections/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10401,7 +10602,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_forwarding_request[] @@ -10411,9 +10612,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/forwarding/requests` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -10426,10 +10628,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10455,21 +10657,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/forwarding/requests` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10480,22 +10683,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/forwarding/requests/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10519,7 +10723,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_identity_verification_report[] @@ -10529,9 +10733,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/identity/verification_reports` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_reference_id: p["clientReferenceId"], created: p["created"], @@ -10547,10 +10752,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10561,22 +10766,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/identity/verification_reports/${p["report"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10600,7 +10806,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_identity_verification_session[] @@ -10610,9 +10816,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/identity/verification_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_reference_id: p["clientReferenceId"], created: p["created"], @@ -10628,10 +10835,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10664,21 +10871,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/identity/verification_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10689,22 +10897,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/identity/verification_sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10734,21 +10943,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/identity/verification_sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10760,21 +10970,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/identity/verification_sessions/${p["session"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10786,21 +10997,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/identity/verification_sessions/${p["session"]}/redact` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10824,7 +11036,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_invoiceitem[] @@ -10834,9 +11046,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/invoiceitems` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -10852,10 +11065,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10903,21 +11116,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoiceitems` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10927,21 +11141,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoiceitems/${p["invoiceitem"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -10952,22 +11167,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoiceitems/${p["invoiceitem"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11012,21 +11228,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoiceitems/${p["invoiceitem"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11059,7 +11276,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_invoice[] @@ -11069,9 +11286,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/invoices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ collection_method: p["collectionMethod"], created: p["created"], @@ -11089,10 +11307,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11313,21 +11531,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11658,21 +11877,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/create_preview` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -11685,7 +11905,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_invoice[] @@ -11697,9 +11917,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/invoices/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -11711,10 +11932,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12093,12 +12314,13 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/upcoming` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ automatic_tax: p["automaticTax"], coupon: p["coupon"], @@ -12132,10 +12354,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12517,7 +12739,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_line_item[] @@ -12527,9 +12749,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/invoices/upcoming/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ automatic_tax: p["automaticTax"], coupon: p["coupon"], @@ -12566,10 +12789,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12579,21 +12802,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12604,22 +12828,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12842,21 +13067,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12942,21 +13168,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/add_lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12969,21 +13196,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/finalize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -12997,7 +13225,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_line_item[] @@ -13007,9 +13235,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/invoices/${p["invoice"]}/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -13021,10 +13250,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13103,21 +13332,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/lines/${p["lineItemId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13129,21 +13359,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/mark_uncollectible` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13161,21 +13392,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/pay` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13196,21 +13428,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/remove_lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13222,21 +13455,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/send` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13322,21 +13556,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/update_lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13348,21 +13583,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/invoices/${p["invoice"]}/void` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13386,7 +13622,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_authorization[] @@ -13396,9 +13632,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/authorizations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ card: p["card"], cardholder: p["cardholder"], @@ -13414,10 +13651,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13428,22 +13665,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/authorizations/${p["authorization"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13460,21 +13698,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/authorizations/${p["authorization"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13492,21 +13731,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/authorizations/${p["authorization"]}/approve` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13523,21 +13763,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/authorizations/${p["authorization"]}/decline` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -13562,7 +13803,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_cardholder[] @@ -13572,9 +13813,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/cardholders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], email: p["email"], @@ -13591,10 +13833,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14555,21 +14797,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/cardholders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -14580,22 +14823,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/cardholders/${p["cardholder"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15555,21 +15799,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/cardholders/${p["cardholder"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -15597,7 +15842,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_card[] @@ -15607,9 +15852,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ cardholder: p["cardholder"], created: p["created"], @@ -15629,10 +15875,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16587,21 +16833,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -16612,22 +16859,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/cards/${p["card"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17579,21 +17827,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/cards/${p["card"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17616,7 +17865,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_dispute[] @@ -17626,9 +17875,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/disputes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -17643,10 +17893,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17748,21 +17998,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/disputes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17773,22 +18024,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17889,21 +18141,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17920,21 +18173,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/disputes/${p["dispute"]}/submit` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -17953,7 +18207,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_personalization_design[] @@ -17963,9 +18217,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/personalization_designs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -17980,10 +18235,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18011,21 +18266,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/personalization_designs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18036,22 +18292,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/personalization_designs/${p["personalizationDesign"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18082,21 +18339,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/personalization_designs/${p["personalizationDesign"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18111,7 +18369,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_physical_bundle[] @@ -18121,9 +18379,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/physical_bundles` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -18137,10 +18396,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18151,22 +18410,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/physical_bundles/${p["physicalBundle"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18177,22 +18437,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/settlements/${p["settlement"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18207,21 +18468,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/settlements/${p["settlement"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18244,7 +18506,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_token[] @@ -18254,9 +18516,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ card: p["card"], created: p["created"], @@ -18271,10 +18534,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18285,22 +18548,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/tokens/${p["token"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18313,21 +18577,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/tokens/${p["token"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18351,7 +18616,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_issuing_transaction[] @@ -18361,9 +18626,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/issuing/transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ card: p["card"], cardholder: p["cardholder"], @@ -18379,10 +18645,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18393,22 +18659,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18425,21 +18692,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/issuing/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18473,21 +18741,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/link_account_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18498,22 +18767,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/link_account_sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18531,7 +18801,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_financial_connections_account[] @@ -18541,9 +18811,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/linked_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ account_holder: p["accountHolder"], ending_before: p["endingBefore"], @@ -18557,10 +18828,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18571,22 +18842,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/linked_accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18598,21 +18870,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/linked_accounts/${p["account"]}/disconnect` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18627,7 +18900,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_financial_connections_account_owner[] @@ -18637,9 +18910,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/linked_accounts/${p["account"]}/owners` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -18652,10 +18926,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18668,21 +18942,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/linked_accounts/${p["account"]}/refresh` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18693,22 +18968,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/mandates/${p["mandate"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -18730,7 +19006,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_intent[] @@ -18740,9 +19016,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -18756,10 +19033,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19478,21 +19755,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19505,7 +19783,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_intent[] @@ -19517,9 +19795,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_intents/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -19531,10 +19810,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -19546,12 +19825,13 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_secret: p["clientSecret"], expand: p["expand"], @@ -19561,10 +19841,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20258,21 +20538,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20286,21 +20567,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}/apply_customer_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20317,21 +20599,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -20356,21 +20639,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}/capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21079,21 +21363,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}/confirm` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21115,21 +21400,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}/increment_authorization` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21144,21 +21430,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_intents/${p["intent"]}/verify_microdeposits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21172,7 +21459,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_link[] @@ -21182,9 +21469,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], ending_before: p["endingBefore"], @@ -21197,10 +21485,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21655,21 +21943,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -21680,22 +21969,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_links/${p["paymentLink"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22140,21 +22430,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_links/${p["paymentLink"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22168,7 +22459,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_item[] @@ -22178,9 +22469,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_links/${p["paymentLink"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -22192,10 +22484,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22209,7 +22501,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_method_configuration[] @@ -22219,9 +22511,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_method_configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ application: p["application"], ending_before: p["endingBefore"], @@ -22234,10 +22527,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22455,21 +22748,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22480,22 +22774,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22714,21 +23009,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22743,7 +23039,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_method_domain[] @@ -22753,9 +23049,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_method_domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ domain_name: p["domainName"], enabled: p["enabled"], @@ -22769,10 +23066,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22785,21 +23082,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22810,22 +23108,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_domains/${p["paymentMethodDomain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22838,21 +23137,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_domains/${p["paymentMethodDomain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22864,21 +23164,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_method_domains/${p["paymentMethodDomain"]}/validate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -22930,7 +23231,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payment_method[] @@ -22940,9 +23241,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payment_methods` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], ending_before: p["endingBefore"], @@ -22956,10 +23258,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23210,21 +23512,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_methods` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23235,22 +23538,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_methods/${p["paymentMethod"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23295,21 +23599,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_methods/${p["paymentMethod"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23322,21 +23627,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_methods/${p["paymentMethod"]}/attach` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23348,21 +23654,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payment_methods/${p["paymentMethod"]}/detach` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23393,7 +23700,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_payout[] @@ -23403,9 +23710,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/payouts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ arrival_date: p["arrivalDate"], created: p["created"], @@ -23421,10 +23729,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23445,21 +23753,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payouts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23470,22 +23779,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payouts/${p["payout"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23502,21 +23812,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payouts/${p["payout"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23528,21 +23839,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payouts/${p["payout"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23557,21 +23869,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/payouts/${p["payout"]}/reverse` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23594,7 +23907,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_plan[] @@ -23604,9 +23917,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/plans` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -23621,10 +23935,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23678,21 +23992,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/plans` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23702,21 +24017,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/plans/${p["plan"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23727,22 +24043,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/plans/${p["plan"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23763,21 +24080,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/plans/${p["plan"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23808,7 +24126,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_price[] @@ -23818,9 +24136,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/prices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -23839,10 +24158,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23924,21 +24243,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/prices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23951,7 +24271,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_price[] @@ -23963,9 +24283,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/prices/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -23977,10 +24298,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -23991,22 +24312,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/prices/${p["price"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24052,21 +24374,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/prices/${p["price"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24091,7 +24414,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_product[] @@ -24101,9 +24424,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/products` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -24120,10 +24444,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24188,21 +24512,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24215,7 +24540,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_product[] @@ -24227,9 +24552,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/products/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -24241,10 +24567,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24254,21 +24580,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24279,22 +24606,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24334,21 +24662,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24362,7 +24691,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_product_feature[] @@ -24372,9 +24701,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/products/${p["product"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -24386,10 +24716,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24402,21 +24732,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products/${p["product"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24427,21 +24758,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products/${p["product"]}/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24453,22 +24785,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/products/${p["product"]}/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24493,7 +24826,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_promotion_code[] @@ -24503,9 +24836,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/promotion_codes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], code: p["code"], @@ -24522,10 +24856,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24557,21 +24891,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/promotion_codes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24582,22 +24917,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/promotion_codes/${p["promotionCode"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24624,21 +24960,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/promotion_codes/${p["promotionCode"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24654,7 +24991,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_quote[] @@ -24664,9 +25001,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/quotes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], ending_before: p["endingBefore"], @@ -24681,10 +25019,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24772,21 +25110,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24797,22 +25136,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes/${p["quote"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24897,21 +25237,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes/${p["quote"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24923,21 +25264,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes/${p["quote"]}/accept` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24949,21 +25291,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes/${p["quote"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -24977,7 +25320,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_item[] @@ -24987,9 +25330,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/quotes/${p["quote"]}/computed_upfront_line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -25001,10 +25345,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25017,21 +25361,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes/${p["quote"]}/finalize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25045,7 +25390,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_item[] @@ -25055,9 +25400,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/quotes/${p["quote"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -25069,10 +25415,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25083,22 +25429,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/quotes/${p["quote"]}/pdf` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25121,7 +25468,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_radar_early_fraud_warning[] @@ -25131,9 +25478,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/radar/early_fraud_warnings` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -25148,10 +25496,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25162,22 +25510,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/early_fraud_warnings/${p["earlyFraudWarning"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25200,7 +25549,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_radar_value_list_item[] @@ -25210,9 +25559,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/radar/value_list_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -25227,10 +25577,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25243,21 +25593,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_list_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25267,21 +25618,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_list_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25292,22 +25644,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_list_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25330,7 +25683,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_radar_value_list[] @@ -25340,9 +25693,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/radar/value_lists` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ alias: p["alias"], contains: p["contains"], @@ -25357,10 +25711,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25387,21 +25741,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_lists` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25411,21 +25766,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_lists/${p["valueList"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25436,22 +25792,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_lists/${p["valueList"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25468,21 +25825,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/radar/value_lists/${p["valueList"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25505,7 +25863,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_refund[] @@ -25515,9 +25873,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -25532,10 +25891,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25561,21 +25920,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25586,22 +25946,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25618,21 +25979,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25644,21 +26006,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/refunds/${p["refund"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -25679,7 +26042,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_reporting_report_run[] @@ -25689,9 +26052,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/reporting/report_runs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -25704,10 +26068,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26364,21 +26728,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/reporting/report_runs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26389,22 +26754,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/reporting/report_runs/${p["reportRun"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26414,7 +26780,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_reporting_report_type[] @@ -26424,19 +26790,20 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/reporting/report_types` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26447,22 +26814,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/reporting/report_types/${p["reportType"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26483,7 +26851,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_review[] @@ -26493,9 +26861,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/reviews` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -26508,10 +26877,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26522,22 +26891,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/reviews/${p["review"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26549,21 +26919,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/reviews/${p["review"]}/approve` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26585,7 +26956,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_setup_attempt[] @@ -26595,9 +26966,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/setup_attempts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -26611,10 +26983,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -26638,7 +27010,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_setup_intent[] @@ -26648,9 +27020,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/setup_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ attach_to_self: p["attachToSelf"], created: p["created"], @@ -26666,10 +27039,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27033,21 +27406,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/setup_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27059,12 +27433,13 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/setup_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_secret: p["clientSecret"], expand: p["expand"], @@ -27074,10 +27449,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27417,21 +27792,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/setup_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27447,21 +27823,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/setup_intents/${p["intent"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27816,21 +28193,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/setup_intents/${p["intent"]}/confirm` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27845,21 +28223,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/setup_intents/${p["intent"]}/verify_microdeposits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27882,7 +28261,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_shipping_rate[] @@ -27892,9 +28271,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/shipping_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -27909,10 +28289,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27952,21 +28332,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/shipping_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -27977,22 +28358,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/shipping_rates/${p["shippingRateToken"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28021,21 +28403,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/shipping_rates/${p["shippingRateToken"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28048,7 +28431,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_scheduled_query_run[] @@ -28058,9 +28441,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/sigma/scheduled_query_runs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28072,10 +28456,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28086,22 +28470,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sigma/scheduled_query_runs/${p["scheduledQueryRun"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28193,21 +28578,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sources` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28219,12 +28605,13 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sources/${p["source"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_secret: p["clientSecret"], expand: p["expand"], @@ -28234,10 +28621,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28318,21 +28705,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sources/${p["source"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28344,22 +28732,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sources/${p["source"]}/mandate_notifications/${p["mandateNotification"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28373,7 +28762,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_source_transaction[] @@ -28383,9 +28772,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/sources/${p["source"]}/source_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28397,10 +28787,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28412,22 +28802,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sources/${p["source"]}/source_transactions/${p["sourceTransaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28440,21 +28831,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/sources/${p["source"]}/verify` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28468,7 +28860,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_subscription_item[] @@ -28478,9 +28870,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/subscription_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28493,10 +28886,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28544,21 +28937,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28572,21 +28966,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28597,22 +28992,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28663,21 +29059,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28691,7 +29088,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_usage_record_summary[] @@ -28701,9 +29098,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/subscription_items/${p["subscriptionItem"]}/usage_record_summaries` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28715,10 +29113,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28733,21 +29131,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_items/${p["subscriptionItem"]}/usage_records` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28794,7 +29193,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_subscription_schedule[] @@ -28804,9 +29203,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/subscription_schedules` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ canceled_at: p["canceledAt"], completed_at: p["completedAt"], @@ -28824,10 +29224,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -28981,21 +29381,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_schedules` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29006,22 +29407,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_schedules/${p["schedule"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29174,21 +29576,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_schedules/${p["schedule"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29202,21 +29605,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_schedules/${p["schedule"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29229,21 +29633,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscription_schedules/${p["schedule"]}/release` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29298,7 +29703,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_subscription[] @@ -29308,9 +29713,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ automatic_tax: p["automaticTax"], collection_method: p["collectionMethod"], @@ -29331,10 +29737,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29583,21 +29989,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29610,7 +30017,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_subscription[] @@ -29622,9 +30029,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/subscriptions/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -29636,10 +30044,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29666,21 +30074,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29691,22 +30100,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29972,21 +30382,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -29996,21 +30407,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscriptions/${p["subscriptionExposedId"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30025,21 +30437,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/subscriptions/${p["subscription"]}/resume` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30167,21 +30580,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/calculations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30192,22 +30606,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/calculations/${p["calculation"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30221,7 +30636,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_calculation_line_item[] @@ -30231,9 +30646,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/tax/calculations/${p["calculation"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30245,10 +30661,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30262,7 +30678,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_registration[] @@ -30272,9 +30688,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/tax/registrations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30287,10 +30704,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30569,21 +30986,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/registrations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30594,22 +31012,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/registrations/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30623,21 +31042,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/registrations/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30647,22 +31067,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/settings` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30687,21 +31108,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/settings` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30718,21 +31140,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/transactions/create_from_calculation` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30764,21 +31187,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/transactions/create_reversal` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30789,22 +31213,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30818,7 +31243,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_transaction_line_item[] @@ -30828,9 +31253,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/tax/transactions/${p["transaction"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30842,10 +31268,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30858,7 +31284,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_code[] @@ -30868,9 +31294,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/tax_codes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30882,10 +31309,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30896,22 +31323,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_codes/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -30929,7 +31357,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_id[] @@ -30939,9 +31367,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30954,10 +31383,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31048,21 +31477,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31072,21 +31502,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31097,22 +31528,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31135,7 +31567,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_tax_rate[] @@ -31145,9 +31577,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/tax_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -31162,10 +31595,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31200,21 +31633,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31225,22 +31659,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_rates/${p["taxRate"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31276,21 +31711,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tax_rates/${p["taxRate"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31304,7 +31740,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_terminal_configuration[] @@ -31314,9 +31750,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/terminal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31329,10 +31766,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31436,21 +31873,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31460,21 +31898,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31485,24 +31924,25 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse > { const url = `/v1/terminal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31615,23 +32055,24 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse > { const url = `/v1/terminal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31643,21 +32084,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/connection_tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31670,7 +32112,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_terminal_location[] @@ -31680,9 +32122,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/terminal/locations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31694,10 +32137,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31723,21 +32166,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/locations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31747,21 +32191,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/locations/${p["location"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31772,22 +32217,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/locations/${p["location"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31814,21 +32260,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/locations/${p["location"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31853,7 +32300,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_terminal_reader[] @@ -31863,9 +32310,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/terminal/readers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ device_type: p["deviceType"], ending_before: p["endingBefore"], @@ -31881,10 +32329,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31903,21 +32351,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31927,21 +32376,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31952,22 +32402,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -31985,21 +32436,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32011,21 +32463,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}/cancel_action` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32045,21 +32498,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}/process_payment_intent` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32076,21 +32530,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}/process_setup_intent` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32113,21 +32568,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}/refund_payment` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32150,21 +32606,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/terminal/readers/${p["reader"]}/set_reader_display` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32416,21 +32873,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/confirmation_tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32445,21 +32903,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/customers/${p["customer"]}/fund_cash_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32862,21 +33321,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/authorizations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32966,21 +33426,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -32992,21 +33453,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/expire` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33068,21 +33530,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/finalize_amount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33096,21 +33559,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/increment` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33123,21 +33587,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/reverse` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33149,21 +33614,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/deliver` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33175,21 +33641,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33201,21 +33668,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33227,21 +33695,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/ship` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33253,21 +33722,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/personalization_designs/${p["personalizationDesign"]}/activate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33279,21 +33749,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/personalization_designs/${p["personalizationDesign"]}/deactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33326,21 +33797,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/personalization_designs/${p["personalizationDesign"]}/reject` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33359,21 +33831,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/settlements` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -33768,21 +34241,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/transactions/create_force_capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34177,21 +34651,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/transactions/create_unlinked_refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34204,21 +34679,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/issuing/transactions/${p["transaction"]}/refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34230,21 +34706,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/refunds/${p["refund"]}/expire` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34264,21 +34741,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/terminal/readers/${p["reader"]}/present_payment_method` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34291,7 +34769,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_test_helpers_test_clock[] @@ -34301,9 +34779,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/test_helpers/test_clocks` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -34315,10 +34794,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34331,21 +34810,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/test_clocks` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34355,21 +34835,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/test_clocks/${p["testClock"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34380,22 +34861,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/test_clocks/${p["testClock"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34408,21 +34890,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/test_clocks/${p["testClock"]}/advance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34450,21 +34933,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/inbound_transfers/${p["id"]}/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34476,21 +34960,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/inbound_transfers/${p["id"]}/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34502,21 +34987,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/inbound_transfers/${p["id"]}/succeed` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34539,21 +35025,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_payments/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34565,21 +35052,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_payments/${p["id"]}/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34591,21 +35079,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_payments/${p["id"]}/post` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34630,21 +35119,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_payments/${p["id"]}/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34667,21 +35157,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34693,21 +35184,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34719,21 +35211,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}/post` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34758,21 +35251,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34796,21 +35290,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/received_credits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -34834,21 +35329,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/test_helpers/treasury/received_debits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35162,21 +35658,22 @@ export class ApiClient extends AbstractAxiosClient { } } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35187,22 +35684,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/tokens/${p["token"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35232,7 +35730,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_topup[] @@ -35242,9 +35740,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/topups` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ amount: p["amount"], created: p["created"], @@ -35259,10 +35758,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35284,21 +35783,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/topups` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35309,22 +35809,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/topups/${p["topup"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35342,21 +35843,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/topups/${p["topup"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35368,21 +35870,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/topups/${p["topup"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35405,7 +35908,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_transfer[] @@ -35415,9 +35918,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], destination: p["destination"], @@ -35432,10 +35936,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35456,21 +35960,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35484,7 +35989,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_transfer_reversal[] @@ -35494,9 +35999,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/transfers/${p["id"]}/reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -35508,10 +36014,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35531,21 +36037,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/transfers/${p["id"]}/reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35556,22 +36063,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/transfers/${p["transfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35589,21 +36097,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/transfers/${p["transfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35615,22 +36124,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/transfers/${p["transfer"]}/reversals/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35648,21 +36158,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/transfers/${p["transfer"]}/reversals/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35678,7 +36189,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_credit_reversal[] @@ -35688,9 +36199,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/credit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -35705,10 +36217,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35723,21 +36235,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/credit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35748,22 +36261,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/credit_reversals/${p["creditReversal"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35780,7 +36294,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_debit_reversal[] @@ -35790,9 +36304,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/debit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -35808,10 +36323,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35826,21 +36341,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/debit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35851,22 +36367,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/debit_reversals/${p["debitReversal"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35887,7 +36404,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_financial_account[] @@ -35897,9 +36414,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/financial_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -35912,10 +36430,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35971,21 +36489,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/financial_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -35996,22 +36515,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/financial_accounts/${p["financialAccount"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36067,21 +36587,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/financial_accounts/${p["financialAccount"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36092,22 +36613,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/financial_accounts/${p["financialAccount"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36154,21 +36676,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/financial_accounts/${p["financialAccount"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36183,7 +36706,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_inbound_transfer[] @@ -36193,9 +36716,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/inbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36209,10 +36733,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36232,21 +36756,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/inbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36257,22 +36782,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/inbound_transfers/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36284,21 +36810,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/inbound_transfers/${p["inboundTransfer"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36322,7 +36849,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_outbound_payment[] @@ -36332,9 +36859,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/outbound_payments` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -36350,10 +36878,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36414,21 +36942,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/outbound_payments` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36439,22 +36968,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/outbound_payments/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36466,21 +36996,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/outbound_payments/${p["id"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36495,7 +37026,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_outbound_transfer[] @@ -36505,9 +37036,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/outbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36521,10 +37053,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36551,21 +37083,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/outbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36576,22 +37109,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/outbound_transfers/${p["outboundTransfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36603,21 +37137,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/outbound_transfers/${p["outboundTransfer"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36639,7 +37174,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_received_credit[] @@ -36649,9 +37184,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/received_credits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36666,10 +37202,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36680,22 +37216,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/received_credits/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36710,7 +37247,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_received_debit[] @@ -36720,9 +37257,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/received_debits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36736,10 +37274,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36750,22 +37288,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/received_debits/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36797,7 +37336,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_transaction_entry[] @@ -36807,9 +37346,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/transaction_entries` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], effective_at: p["effectiveAt"], @@ -36826,10 +37366,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36840,22 +37380,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/transaction_entries/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36889,7 +37430,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_treasury_transaction[] @@ -36899,9 +37440,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/treasury/transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -36918,10 +37460,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36932,22 +37474,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/treasury/transactions/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -36960,7 +37503,7 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ data: t_webhook_endpoint[] @@ -36970,9 +37513,10 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/v1/webhook_endpoints` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36984,10 +37528,10 @@ export class ApiClient extends AbstractAxiosClient { return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -37349,21 +37893,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/webhook_endpoints` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -37373,21 +37918,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/webhook_endpoints/${p["webhookEndpoint"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "DELETE", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -37398,22 +37944,23 @@ export class ApiClient extends AbstractAxiosClient { requestBody?: EmptyObject }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/webhook_endpoints/${p["webhookEndpoint"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._request({ url: url + query, method: "GET", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -37673,21 +38220,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/v1/webhook_endpoints/${p["webhookEndpoint"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-axios/src/generated/todo-lists.yaml/client.ts b/integration-tests/typescript-axios/src/generated/todo-lists.yaml/client.ts index fd4708d2..ca5a10a8 100644 --- a/integration-tests/typescript-axios/src/generated/todo-lists.yaml/client.ts +++ b/integration-tests/typescript-axios/src/generated/todo-lists.yaml/client.ts @@ -21,9 +21,10 @@ export class ApiClient extends AbstractAxiosClient { tags?: string[] } = {}, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/list` + const headers = this._headers({}, opts.headers) const query = this._query({ created: p["created"], statuses: p["statuses"], @@ -34,7 +35,8 @@ export class ApiClient extends AbstractAxiosClient { url: url + query, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -43,15 +45,17 @@ export class ApiClient extends AbstractAxiosClient { listId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/list/${p["listId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -61,19 +65,22 @@ export class ApiClient extends AbstractAxiosClient { requestBody: t_CreateUpdateTodoList }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/list/${p["listId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "PUT", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -82,15 +89,17 @@ export class ApiClient extends AbstractAxiosClient { listId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/list/${p["listId"]}` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "DELETE", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -99,7 +108,7 @@ export class ApiClient extends AbstractAxiosClient { listId: string }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise< AxiosResponse<{ completedAt?: string @@ -109,12 +118,14 @@ export class ApiClient extends AbstractAxiosClient { }> > { const url = `/list/${p["listId"]}/items` + const headers = this._headers({}, opts.headers) return this._request({ url: url, method: "GET", ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } @@ -128,19 +139,22 @@ export class ApiClient extends AbstractAxiosClient { } }, timeout?: number, - opts?: AxiosRequestConfig, + opts: AxiosRequestConfig = {}, ): Promise> { const url = `/list/${p["listId"]}/items` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._request({ url: url, method: "POST", - headers, data: body, ...(timeout ? { timeout } : {}), - ...(opts ?? {}), + ...opts, + headers, }) } } diff --git a/integration-tests/typescript-fetch/src/generated/api.github.com.yaml/client.ts b/integration-tests/typescript-fetch/src/generated/api.github.com.yaml/client.ts index 94771f26..c8bdecc8 100644 --- a/integration-tests/typescript-fetch/src/generated/api.github.com.yaml/client.ts +++ b/integration-tests/typescript-fetch/src/generated/api.github.com.yaml/client.ts @@ -323,11 +323,12 @@ export class ApiClient extends AbstractFetchClient { async metaRoot( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async securityAdvisoriesListGlobalAdvisories( @@ -350,7 +351,7 @@ export class ApiClient extends AbstractFetchClient { sort?: "updated" | "published" } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_global_advisory[]> @@ -359,6 +360,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/advisories` + const headers = this._headers({}, opts.headers) const query = this._query({ ghsa_id: p["ghsaId"], type: p["type"], @@ -378,7 +380,11 @@ export class ApiClient extends AbstractFetchClient { sort: p["sort"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async securityAdvisoriesGetGlobalAdvisory( @@ -386,22 +392,24 @@ export class ApiClient extends AbstractFetchClient { ghsaId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/advisories/${p["ghsaId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsGetAuthenticated( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/app` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsCreateFromManifest( @@ -409,7 +417,7 @@ export class ApiClient extends AbstractFetchClient { code: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -427,17 +435,19 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/app-manifests/${p["code"]}/conversions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async appsGetWebhookConfigForApp( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/app/hook/config` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsUpdateWebhookConfigForApp( @@ -450,15 +460,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/app/hook/config` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -470,7 +483,7 @@ export class ApiClient extends AbstractFetchClient { redelivery?: boolean } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hook_delivery_item[]> @@ -479,13 +492,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/app/hook/deliveries` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], cursor: p["cursor"], redelivery: p["redelivery"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsGetWebhookDelivery( @@ -493,7 +511,7 @@ export class ApiClient extends AbstractFetchClient { deliveryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hook_delivery> @@ -502,8 +520,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/app/hook/deliveries/${p["deliveryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsRedeliverWebhookDelivery( @@ -511,7 +530,7 @@ export class ApiClient extends AbstractFetchClient { deliveryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -526,8 +545,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/app/hook/deliveries/${p["deliveryId"]}/attempts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async appsListInstallationRequestsForAuthenticatedApp( @@ -536,7 +556,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_integration_installation_request[]> @@ -545,9 +565,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/app/installation-requests` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsListInstallations( @@ -558,9 +583,10 @@ export class ApiClient extends AbstractFetchClient { outdated?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/app/installations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -568,7 +594,11 @@ export class ApiClient extends AbstractFetchClient { outdated: p["outdated"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsGetInstallation( @@ -576,13 +606,14 @@ export class ApiClient extends AbstractFetchClient { installationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/app/installations/${p["installationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsDeleteInstallation( @@ -590,11 +621,12 @@ export class ApiClient extends AbstractFetchClient { installationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/app/installations/${p["installationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async appsCreateInstallationAccessToken( @@ -607,7 +639,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_installation_token> @@ -619,14 +651,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/app/installations/${p["installationId"]}/access_tokens` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async appsSuspendInstallation( @@ -634,12 +665,13 @@ export class ApiClient extends AbstractFetchClient { installationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/app/installations/${p["installationId"]}/suspended` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async appsUnsuspendInstallation( @@ -647,12 +679,13 @@ export class ApiClient extends AbstractFetchClient { installationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/app/installations/${p["installationId"]}/suspended` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async appsDeleteAuthorization( @@ -663,17 +696,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/applications/${p["clientId"]}/grant` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -686,7 +722,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_authorization> @@ -695,14 +731,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/applications/${p["clientId"]}/token` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async appsResetToken( @@ -713,17 +748,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/applications/${p["clientId"]}/token` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -736,17 +774,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/applications/${p["clientId"]}/token` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -764,7 +805,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_authorization> @@ -775,14 +816,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/applications/${p["clientId"]}/token/scoped` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async appsGetBySlug( @@ -790,7 +830,7 @@ export class ApiClient extends AbstractFetchClient { appSlug: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_integration> @@ -799,8 +839,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/apps/${p["appSlug"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async classroomGetAnAssignment( @@ -808,15 +849,16 @@ export class ApiClient extends AbstractFetchClient { assignmentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_classroom_assignment> | Res<404, t_basic_error> > > { const url = this.basePath + `/assignments/${p["assignmentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async classroomListAcceptedAssigmentsForAnAssignment( @@ -826,13 +868,18 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/assignments/${p["assignmentId"]}/accepted_assignments` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async classroomGetAssignmentGrades( @@ -840,15 +887,16 @@ export class ApiClient extends AbstractFetchClient { assignmentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_classroom_assignment_grade[]> | Res<404, t_basic_error> > > { const url = this.basePath + `/assignments/${p["assignmentId"]}/grades` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async classroomListClassrooms( @@ -857,12 +905,17 @@ export class ApiClient extends AbstractFetchClient { perPage?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/classrooms` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async classroomGetAClassroom( @@ -870,13 +923,14 @@ export class ApiClient extends AbstractFetchClient { classroomId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/classrooms/${p["classroomId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async classroomListAssignmentsForAClassroom( @@ -886,23 +940,29 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/classrooms/${p["classroomId"]}/assignments` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codesOfConductGetAllCodesOfConduct( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<304, void>> > { const url = this.basePath + `/codes_of_conduct` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codesOfConductGetConductCode( @@ -910,20 +970,21 @@ export class ApiClient extends AbstractFetchClient { key: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_code_of_conduct> | Res<304, void> | Res<404, t_basic_error> > > { const url = this.basePath + `/codes_of_conduct/${p["key"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async emojisGet( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -936,8 +997,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/emojis` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async copilotListCopilotSeatsForEnterprise( @@ -947,7 +1009,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -965,9 +1027,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/enterprises/${p["enterprise"]}/copilot/billing/seats` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async copilotUsageMetricsForEnterprise( @@ -979,7 +1046,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_copilot_usage_metrics[]> @@ -990,6 +1057,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/enterprises/${p["enterprise"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -997,7 +1065,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotListAlertsForEnterprise( @@ -1017,7 +1089,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependabot_alert_with_repository[]> @@ -1029,6 +1101,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/enterprises/${p["enterprise"]}/dependabot/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], severity: p["severity"], @@ -1044,7 +1117,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async secretScanningListAlertsForEnterprise( @@ -1061,7 +1138,7 @@ export class ApiClient extends AbstractFetchClient { validity?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_secret_scanning_alert[]> @@ -1078,6 +1155,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/enterprises/${p["enterprise"]}/secret-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], secret_type: p["secretType"], @@ -1090,7 +1168,11 @@ export class ApiClient extends AbstractFetchClient { validity: p["validity"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async copilotUsageMetricsForEnterpriseTeam( @@ -1103,7 +1185,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_copilot_usage_metrics[]> @@ -1116,6 +1198,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/enterprises/${p["enterprise"]}/team/${p["teamSlug"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -1123,7 +1206,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListPublicEvents( @@ -1132,7 +1219,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_event[]> @@ -1149,18 +1236,24 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityGetFeeds( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/feeds` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gistsList( @@ -1170,20 +1263,25 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_base_gist[]> | Res<304, void> | Res<403, t_basic_error> > > { const url = this.basePath + `/gists` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async gistsCreate( @@ -1201,7 +1299,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_gist_simple> @@ -1212,14 +1310,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gistsListPublic( @@ -1229,7 +1326,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_base_gist[]> @@ -1239,13 +1336,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/public` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async gistsListStarred( @@ -1255,7 +1357,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_base_gist[]> @@ -1265,13 +1367,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/starred` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async gistsGet( @@ -1279,7 +1386,7 @@ export class ApiClient extends AbstractFetchClient { gistId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_simple> @@ -1300,8 +1407,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gistsUpdate( @@ -1320,7 +1428,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_simple> @@ -1329,12 +1437,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -1344,7 +1455,7 @@ export class ApiClient extends AbstractFetchClient { gistId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -1354,8 +1465,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async gistsListComments( @@ -1365,7 +1477,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_comment[]> @@ -1375,9 +1487,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async gistsCreateComment( @@ -1388,7 +1505,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_gist_comment> @@ -1398,14 +1515,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gistsGetComment( @@ -1414,7 +1530,7 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_comment> @@ -1436,8 +1552,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/gists/${p["gistId"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gistsUpdateComment( @@ -1449,18 +1566,21 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/gists/${p["gistId"]}/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -1471,7 +1591,7 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -1482,8 +1602,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/gists/${p["gistId"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async gistsListCommits( @@ -1493,7 +1614,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_commit[]> @@ -1503,9 +1624,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async gistsListForks( @@ -1515,7 +1641,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_simple[]> @@ -1525,9 +1651,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/forks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async gistsFork( @@ -1535,7 +1666,7 @@ export class ApiClient extends AbstractFetchClient { gistId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_base_gist> @@ -1546,8 +1677,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/forks` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async gistsCheckIsStarred( @@ -1555,7 +1687,7 @@ export class ApiClient extends AbstractFetchClient { gistId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -1565,8 +1697,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/star` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gistsStar( @@ -1574,7 +1707,7 @@ export class ApiClient extends AbstractFetchClient { gistId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -1584,8 +1717,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/star` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async gistsUnstar( @@ -1593,7 +1727,7 @@ export class ApiClient extends AbstractFetchClient { gistId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -1603,8 +1737,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/star` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async gistsGetRevision( @@ -1613,7 +1748,7 @@ export class ApiClient extends AbstractFetchClient { sha: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gist_simple> @@ -1623,17 +1758,19 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/gists/${p["gistId"]}/${p["sha"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitignoreGetAllTemplates( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<304, void>>> { const url = this.basePath + `/gitignore/templates` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitignoreGetTemplate( @@ -1641,13 +1778,14 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<304, void>> > { const url = this.basePath + `/gitignore/templates/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsListReposAccessibleToInstallation( @@ -1656,7 +1794,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -1673,18 +1811,24 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/installation/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsRevokeInstallationAccessToken( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/installation/token` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesList( @@ -1709,7 +1853,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue[]> @@ -1719,6 +1863,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], state: p["state"], @@ -1734,7 +1879,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async licensesGetAllCommonlyUsed( @@ -1744,18 +1893,23 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<304, void>> > { const url = this.basePath + `/licenses` + const headers = this._headers({}, opts.headers) const query = this._query({ featured: p["featured"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async licensesGet( @@ -1763,7 +1917,7 @@ export class ApiClient extends AbstractFetchClient { license: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_license> @@ -1773,8 +1927,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/licenses/${p["license"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async markdownRender( @@ -1786,17 +1941,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<304, void>>> { const url = this.basePath + `/markdown` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async markdownRenderRaw( @@ -1804,17 +1958,16 @@ export class ApiClient extends AbstractFetchClient { requestBody?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<304, void>>> { const url = this.basePath + `/markdown/raw` - const headers = this._headers({ "Content-Type": "text/plain" }) + const headers = this._headers( + { "Content-Type": "text/plain" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async appsGetSubscriptionPlanForAccount( @@ -1822,7 +1975,7 @@ export class ApiClient extends AbstractFetchClient { accountId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_marketplace_purchase> @@ -1832,8 +1985,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/marketplace_listing/accounts/${p["accountId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsListPlans( @@ -1842,7 +1996,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_marketplace_listing_plan[]> @@ -1851,9 +2005,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/marketplace_listing/plans` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsListAccountsForPlan( @@ -1865,7 +2024,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_marketplace_purchase[]> @@ -1876,6 +2035,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/marketplace_listing/plans/${p["planId"]}/accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -1883,7 +2043,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsGetSubscriptionPlanForAccountStubbed( @@ -1891,7 +2055,7 @@ export class ApiClient extends AbstractFetchClient { accountId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_marketplace_purchase> @@ -1901,8 +2065,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/marketplace_listing/stubbed/accounts/${p["accountId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async appsListPlansStubbed( @@ -1911,16 +2076,21 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_marketplace_listing_plan[]> | Res<401, t_basic_error> > > { const url = this.basePath + `/marketplace_listing/stubbed/plans` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsListAccountsForPlanStubbed( @@ -1932,7 +2102,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_marketplace_purchase[]> | Res<401, t_basic_error> @@ -1941,6 +2111,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/marketplace_listing/stubbed/plans/${p["planId"]}/accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -1948,16 +2119,21 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async metaGet( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<304, void>>> { const url = this.basePath + `/meta` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activityListPublicEventsForRepoNetwork( @@ -1968,7 +2144,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_event[]> @@ -1979,9 +2155,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/networks/${p["owner"]}/${p["repo"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListNotificationsForAuthenticatedUser( @@ -1994,7 +2175,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_thread[]> @@ -2005,6 +2186,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/notifications` + const headers = this._headers({}, opts.headers) const query = this._query({ all: p["all"], participating: p["participating"], @@ -2014,7 +2196,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityMarkNotificationsAsRead( @@ -2025,7 +2211,7 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2041,14 +2227,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/notifications` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async activityGetThread( @@ -2056,7 +2241,7 @@ export class ApiClient extends AbstractFetchClient { threadId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_thread> @@ -2066,8 +2251,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/notifications/threads/${p["threadId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activityMarkThreadAsRead( @@ -2075,15 +2261,16 @@ export class ApiClient extends AbstractFetchClient { threadId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<205, void> | Res<304, void> | Res<403, t_basic_error> > > { const url = this.basePath + `/notifications/threads/${p["threadId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PATCH", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PATCH", ...opts, headers }, timeout) } async activityMarkThreadAsDone( @@ -2091,11 +2278,12 @@ export class ApiClient extends AbstractFetchClient { threadId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/notifications/threads/${p["threadId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async activityGetThreadSubscriptionForAuthenticatedUser( @@ -2103,7 +2291,7 @@ export class ApiClient extends AbstractFetchClient { threadId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_thread_subscription> @@ -2114,8 +2302,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/notifications/threads/${p["threadId"]}/subscription` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activitySetThreadSubscription( @@ -2126,7 +2315,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_thread_subscription> @@ -2137,14 +2326,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/notifications/threads/${p["threadId"]}/subscription` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async activityDeleteThreadSubscription( @@ -2152,7 +2340,7 @@ export class ApiClient extends AbstractFetchClient { threadId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -2163,8 +2351,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/notifications/threads/${p["threadId"]}/subscription` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async metaGetOctocat( @@ -2172,12 +2361,17 @@ export class ApiClient extends AbstractFetchClient { s?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/octocat` + const headers = this._headers({}, opts.headers) const query = this._query({ s: p["s"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsList( @@ -2186,14 +2380,19 @@ export class ApiClient extends AbstractFetchClient { perPage?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<304, void>> > { const url = this.basePath + `/organizations` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsGet( @@ -2201,13 +2400,14 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsUpdate( @@ -2246,7 +2446,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_full> @@ -2255,12 +2455,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -2270,7 +2473,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2284,8 +2487,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsGetActionsCacheUsageForOrg( @@ -2293,13 +2497,14 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/orgs/${p["org"]}/actions/cache/usage` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGetActionsCacheUsageByRepoForOrg( @@ -2309,7 +2514,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -2323,9 +2528,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/actions/cache/usage-by-repository` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async oidcGetOidcCustomSubTemplateForOrg( @@ -2333,12 +2543,13 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/oidc/customization/sub` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async oidcUpdateOidcCustomSubTemplateForOrg( @@ -2347,7 +2558,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_oidc_custom_sub }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_empty_object> @@ -2357,14 +2568,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/actions/oidc/customization/sub` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsGetGithubActionsPermissionsOrganization( @@ -2372,11 +2582,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetGithubActionsPermissionsOrganization( @@ -2388,17 +2599,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsListSelectedRepositoriesEnabledGithubActionsOrganization( @@ -2408,7 +2618,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -2422,9 +2632,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsSetSelectedRepositoriesEnabledGithubActionsOrganization( @@ -2435,18 +2650,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsEnableSelectedRepositoryGithubActionsOrganization( @@ -2455,13 +2669,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async actionsDisableSelectedRepositoryGithubActionsOrganization( @@ -2470,13 +2685,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsGetAllowedActionsOrganization( @@ -2484,12 +2700,13 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/selected-actions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetAllowedActionsOrganization( @@ -2498,18 +2715,17 @@ export class ApiClient extends AbstractFetchClient { requestBody?: t_selected_actions }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/selected-actions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsGetGithubActionsDefaultWorkflowPermissionsOrganization( @@ -2517,13 +2733,14 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/workflow` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetGithubActionsDefaultWorkflowPermissionsOrganization( @@ -2532,17 +2749,16 @@ export class ApiClient extends AbstractFetchClient { requestBody?: t_actions_set_default_workflow_permissions }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/permissions/workflow` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsListSelfHostedRunnersForOrg( @@ -2553,7 +2769,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -2566,13 +2782,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/actions/runners` + const headers = this._headers({}, opts.headers) const query = this._query({ name: p["name"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsListRunnerApplicationsForOrg( @@ -2580,11 +2801,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/downloads` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGenerateRunnerJitconfigForOrg( @@ -2598,7 +2820,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2614,14 +2836,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/generate-jitconfig` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsCreateRegistrationTokenForOrg( @@ -2629,12 +2850,13 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/registration-token` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsCreateRemoveTokenForOrg( @@ -2642,11 +2864,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/remove-token` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsGetSelfHostedRunnerForOrg( @@ -2655,12 +2878,13 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsDeleteSelfHostedRunnerFromOrg( @@ -2669,12 +2893,13 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListLabelsForSelfHostedRunnerForOrg( @@ -2683,7 +2908,7 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2699,8 +2924,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsAddCustomLabelsToSelfHostedRunnerForOrg( @@ -2712,7 +2938,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2729,14 +2955,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsSetCustomLabelsForSelfHostedRunnerForOrg( @@ -2748,7 +2973,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2765,14 +2990,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg( @@ -2781,7 +3005,7 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2797,8 +3021,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsRemoveCustomLabelFromSelfHostedRunnerForOrg( @@ -2808,7 +3033,7 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2825,8 +3050,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/runners/${p["runnerId"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListOrgSecrets( @@ -2836,7 +3062,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -2849,9 +3075,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetOrgPublicKey( @@ -2859,11 +3090,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGetOrgSecret( @@ -2872,12 +3104,13 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsCreateOrUpdateOrgSecret( @@ -2892,18 +3125,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<204, void>>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsDeleteOrgSecret( @@ -2912,12 +3144,13 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListSelectedReposForOrgSecret( @@ -2928,7 +3161,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -2943,9 +3176,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsSetSelectedReposForOrgSecret( @@ -2957,19 +3195,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsAddSelectedRepoToOrgSecret( @@ -2979,13 +3216,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async actionsRemoveSelectedRepoFromOrgSecret( @@ -2995,13 +3233,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/actions/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListOrgVariables( @@ -3011,7 +3250,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -3024,9 +3263,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/actions/variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsCreateOrgVariable( @@ -3040,17 +3284,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsGetOrgVariable( @@ -3059,12 +3302,13 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsUpdateOrgVariable( @@ -3079,16 +3323,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -3099,12 +3346,13 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListSelectedReposForOrgVariable( @@ -3115,7 +3363,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3131,9 +3379,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsSetSelectedReposForOrgVariable( @@ -3145,19 +3398,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsAddSelectedRepoToOrgVariable( @@ -3167,13 +3419,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async actionsRemoveSelectedRepoFromOrgVariable( @@ -3183,13 +3436,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/actions/variables/${p["name"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsListAttestations( @@ -3201,7 +3455,7 @@ export class ApiClient extends AbstractFetchClient { subjectDigest: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -3225,13 +3479,18 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/attestations/${p["subjectDigest"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], after: p["after"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListBlockedUsers( @@ -3241,12 +3500,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/blocks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsCheckBlockedUser( @@ -3255,11 +3519,12 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsBlockUser( @@ -3268,13 +3533,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/orgs/${p["org"]}/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async orgsUnblockUser( @@ -3283,11 +3549,12 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codeScanningListAlertsForOrg( @@ -3305,7 +3572,7 @@ export class ApiClient extends AbstractFetchClient { severity?: t_code_scanning_alert_severity }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_organization_alert_items[]> @@ -3321,6 +3588,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/code-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ tool_name: p["toolName"], tool_guid: p["toolGuid"], @@ -3334,7 +3602,11 @@ export class ApiClient extends AbstractFetchClient { severity: p["severity"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codeSecurityGetConfigurationsForOrg( @@ -3346,7 +3618,7 @@ export class ApiClient extends AbstractFetchClient { after?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_security_configuration[]> @@ -3355,6 +3627,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations` + const headers = this._headers({}, opts.headers) const query = this._query({ target_type: p["targetType"], per_page: p["perPage"], @@ -3362,7 +3635,11 @@ export class ApiClient extends AbstractFetchClient { after: p["after"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codeSecurityCreateConfiguration( @@ -3388,17 +3665,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codeSecurityGetDefaultConfigurations( @@ -3406,7 +3682,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_security_default_configurations> @@ -3417,8 +3693,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/defaults` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeSecurityDetachConfiguration( @@ -3429,7 +3706,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3441,12 +3718,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/detach` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -3457,7 +3737,7 @@ export class ApiClient extends AbstractFetchClient { configurationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_security_configuration> @@ -3469,8 +3749,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeSecurityUpdateConfiguration( @@ -3497,19 +3778,22 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<204, void>> > { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -3520,7 +3804,7 @@ export class ApiClient extends AbstractFetchClient { configurationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3533,8 +3817,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codeSecurityAttachConfiguration( @@ -3547,7 +3832,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -3561,14 +3846,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}/attach` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codeSecuritySetConfigurationAsDefault( @@ -3584,7 +3868,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3605,14 +3889,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}/defaults` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codeSecurityGetRepositoriesForConfiguration( @@ -3625,7 +3908,7 @@ export class ApiClient extends AbstractFetchClient { status?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_security_configuration_repositories[]> @@ -3636,6 +3919,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/code-security/configurations/${p["configurationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], @@ -3643,7 +3927,11 @@ export class ApiClient extends AbstractFetchClient { status: p["status"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesListInOrganization( @@ -3653,7 +3941,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3671,9 +3959,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesSetCodespacesAccess( @@ -3689,7 +3982,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3701,14 +3994,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/codespaces/access` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codespacesSetCodespacesAccessUsers( @@ -3719,7 +4011,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3732,14 +4024,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/codespaces/access/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codespacesDeleteCodespacesAccessUsers( @@ -3750,7 +4041,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3763,12 +4054,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/codespaces/access/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -3780,7 +4074,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -3793,9 +4087,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesGetOrgPublicKey( @@ -3803,12 +4102,13 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesGetOrgSecret( @@ -3817,12 +4117,13 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesCreateOrUpdateOrgSecret( @@ -3837,7 +4138,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_empty_object> @@ -3848,14 +4149,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codespacesDeleteOrgSecret( @@ -3864,12 +4164,13 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesListSelectedReposForOrgSecret( @@ -3880,7 +4181,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3896,9 +4197,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesSetSelectedReposForOrgSecret( @@ -3910,7 +4216,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<409, void> @@ -3919,14 +4225,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codespacesAddSelectedRepoToOrgSecret( @@ -3936,7 +4241,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3948,8 +4253,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async codespacesRemoveSelectedRepoFromOrgSecret( @@ -3959,7 +4265,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -3971,8 +4277,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async copilotGetCopilotOrganizationDetails( @@ -3980,7 +4287,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_copilot_organization_details> @@ -3992,8 +4299,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/copilot/billing` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async copilotListCopilotSeats( @@ -4003,7 +4311,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4020,9 +4328,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/copilot/billing/seats` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async copilotAddCopilotSeatsForTeams( @@ -4033,7 +4346,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4051,14 +4364,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/copilot/billing/selected_teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async copilotCancelCopilotSeatAssignmentForTeams( @@ -4069,7 +4381,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4087,12 +4399,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/copilot/billing/selected_teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -4105,7 +4420,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4123,14 +4438,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/copilot/billing/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async copilotCancelCopilotSeatAssignmentForUsers( @@ -4141,7 +4455,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4159,12 +4473,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/copilot/billing/selected_users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -4178,7 +4495,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_copilot_usage_metrics[]> @@ -4189,6 +4506,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -4196,7 +4514,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotListAlertsForOrg( @@ -4216,7 +4538,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependabot_alert_with_repository[]> @@ -4228,6 +4550,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/dependabot/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], severity: p["severity"], @@ -4243,7 +4566,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotListOrgSecrets( @@ -4253,7 +4580,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -4266,9 +4593,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotGetOrgPublicKey( @@ -4276,12 +4608,13 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async dependabotGetOrgSecret( @@ -4290,12 +4623,13 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async dependabotCreateOrUpdateOrgSecret( @@ -4310,18 +4644,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<204, void>>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async dependabotDeleteOrgSecret( @@ -4330,12 +4663,13 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async dependabotListSelectedReposForOrgSecret( @@ -4346,7 +4680,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -4361,9 +4695,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotSetSelectedReposForOrgSecret( @@ -4375,19 +4714,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async dependabotAddSelectedRepoToOrgSecret( @@ -4397,13 +4735,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async dependabotRemoveSelectedRepoFromOrgSecret( @@ -4413,13 +4752,14 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/orgs/${p["org"]}/dependabot/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesListDockerMigrationConflictingPackagesForOrganization( @@ -4427,15 +4767,16 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_package[]> | Res<401, t_basic_error> | Res<403, t_basic_error> > > { const url = this.basePath + `/orgs/${p["org"]}/docker/conflicts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activityListPublicOrgEvents( @@ -4445,12 +4786,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListFailedInvitations( @@ -4460,16 +4806,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_organization_invitation[]> | Res<404, t_basic_error> > > { const url = this.basePath + `/orgs/${p["org"]}/failed_invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListWebhooks( @@ -4479,14 +4830,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/orgs/${p["org"]}/hooks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsCreateWebhook( @@ -4507,7 +4863,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_org_hook> @@ -4516,14 +4872,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/hooks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsGetWebhook( @@ -4532,13 +4887,14 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsUpdateWebhook( @@ -4558,7 +4914,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_hook> @@ -4567,12 +4923,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -4583,11 +4942,12 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsGetWebhookConfigForOrg( @@ -4596,11 +4956,12 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}/config` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsUpdateWebhookConfigForOrg( @@ -4615,15 +4976,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}/config` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -4637,7 +5001,7 @@ export class ApiClient extends AbstractFetchClient { redelivery?: boolean }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hook_delivery_item[]> @@ -4647,13 +5011,18 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}/deliveries` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], cursor: p["cursor"], redelivery: p["redelivery"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsGetWebhookDelivery( @@ -4663,7 +5032,7 @@ export class ApiClient extends AbstractFetchClient { deliveryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hook_delivery> @@ -4674,8 +5043,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsRedeliverWebhookDelivery( @@ -4685,7 +5055,7 @@ export class ApiClient extends AbstractFetchClient { deliveryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4701,8 +5071,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}/attempts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async orgsPingWebhook( @@ -4711,11 +5082,12 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/hooks/${p["hookId"]}/pings` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async appsGetOrgInstallation( @@ -4723,11 +5095,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/installation` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsListAppInstallations( @@ -4737,7 +5110,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -4750,9 +5123,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/installations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async interactionsGetRestrictionsForOrg( @@ -4760,13 +5138,14 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/orgs/${p["org"]}/interaction-limits` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async interactionsSetRestrictionsForOrg( @@ -4775,21 +5154,20 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_interaction_limit }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_interaction_limit_response> | Res<422, t_validation_error> > > { const url = this.basePath + `/orgs/${p["org"]}/interaction-limits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async interactionsRemoveRestrictionsForOrg( @@ -4797,11 +5175,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/interaction-limits` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsListPendingInvitations( @@ -4818,13 +5197,14 @@ export class ApiClient extends AbstractFetchClient { invitationSource?: "all" | "member" | "scim" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_organization_invitation[]> | Res<404, t_basic_error> > > { const url = this.basePath + `/orgs/${p["org"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -4832,7 +5212,11 @@ export class ApiClient extends AbstractFetchClient { invitation_source: p["invitationSource"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsCreateInvitation( @@ -4846,7 +5230,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_organization_invitation> @@ -4855,14 +5239,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/invitations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsCancelInvitation( @@ -4871,7 +5254,7 @@ export class ApiClient extends AbstractFetchClient { invitationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<422, t_validation_error> @@ -4879,8 +5262,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsListInvitationTeams( @@ -4891,13 +5275,18 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/invitations/${p["invitationId"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesListForOrg( @@ -4919,11 +5308,12 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/orgs/${p["org"]}/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], state: p["state"], @@ -4935,7 +5325,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListMembers( @@ -4947,11 +5341,12 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/orgs/${p["org"]}/members` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], role: p["role"], @@ -4959,7 +5354,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsCheckMembershipForUser( @@ -4968,13 +5367,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<302, void> | Res<404, void>> > { const url = this.basePath + `/orgs/${p["org"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsRemoveMember( @@ -4983,11 +5383,12 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<403, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesGetCodespacesForUserInOrg( @@ -4998,7 +5399,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5017,9 +5418,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/members/${p["username"]}/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesDeleteFromOrganization( @@ -5029,7 +5435,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5048,8 +5454,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/members/${p["username"]}/codespaces/${p["codespaceName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesStopInOrganization( @@ -5059,7 +5466,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_codespace> @@ -5073,8 +5480,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/members/${p["username"]}/codespaces/${p["codespaceName"]}/stop` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async copilotGetCopilotSeatDetailsForUser( @@ -5083,7 +5491,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_copilot_seat_details> @@ -5096,8 +5504,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/members/${p["username"]}/copilot` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsGetMembershipForUser( @@ -5106,7 +5515,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_membership> @@ -5115,8 +5524,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsSetMembershipForUser( @@ -5128,7 +5538,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_membership> @@ -5137,14 +5547,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/memberships/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async orgsRemoveMembershipForUser( @@ -5153,15 +5562,16 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<404, t_basic_error> > > { const url = this.basePath + `/orgs/${p["org"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async migrationsListForOrg( @@ -5172,16 +5582,21 @@ export class ApiClient extends AbstractFetchClient { exclude?: "repositories"[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/migrations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], exclude: p["exclude"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async migrationsStartForOrg( @@ -5200,7 +5615,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_migration> @@ -5209,14 +5624,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/migrations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async migrationsGetStatusForOrg( @@ -5226,15 +5640,20 @@ export class ApiClient extends AbstractFetchClient { exclude?: "repositories"[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/orgs/${p["org"]}/migrations/${p["migrationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude: p["exclude"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async migrationsDownloadArchiveForOrg( @@ -5243,12 +5662,13 @@ export class ApiClient extends AbstractFetchClient { migrationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async migrationsDeleteArchiveForOrg( @@ -5257,12 +5677,13 @@ export class ApiClient extends AbstractFetchClient { migrationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async migrationsUnlockRepoForOrg( @@ -5272,13 +5693,14 @@ export class ApiClient extends AbstractFetchClient { repoName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/migrations/${p["migrationId"]}/repos/${p["repoName"]}/lock` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async migrationsListReposForOrg( @@ -5289,7 +5711,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_minimal_repository[]> | Res<404, t_basic_error> @@ -5298,9 +5720,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/migrations/${p["migrationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListOrgRoles( @@ -5308,7 +5735,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5323,8 +5750,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/organization-roles` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsRevokeAllOrgRolesTeam( @@ -5333,13 +5761,14 @@ export class ApiClient extends AbstractFetchClient { teamSlug: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsAssignTeamToOrgRole( @@ -5349,15 +5778,16 @@ export class ApiClient extends AbstractFetchClient { roleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, void> | Res<422, void>> > { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/teams/${p["teamSlug"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async orgsRevokeOrgRoleTeam( @@ -5367,13 +5797,14 @@ export class ApiClient extends AbstractFetchClient { roleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/teams/${p["teamSlug"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsRevokeAllOrgRolesUser( @@ -5382,13 +5813,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/users/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsAssignUserToOrgRole( @@ -5398,15 +5830,16 @@ export class ApiClient extends AbstractFetchClient { roleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, void> | Res<422, void>> > { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/users/${p["username"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async orgsRevokeOrgRoleUser( @@ -5416,13 +5849,14 @@ export class ApiClient extends AbstractFetchClient { roleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/users/${p["username"]}/${p["roleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsGetOrgRole( @@ -5431,7 +5865,7 @@ export class ApiClient extends AbstractFetchClient { roleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_role> @@ -5441,8 +5875,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/${p["roleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsListOrgRoleTeams( @@ -5453,7 +5888,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_team_role_assignment[]> | Res<404, void> | Res<422, void> @@ -5462,9 +5897,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/${p["roleId"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListOrgRoleUsers( @@ -5475,7 +5915,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_user_role_assignment[]> | Res<404, void> | Res<422, void> @@ -5484,9 +5924,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/organization-roles/${p["roleId"]}/users` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListOutsideCollaborators( @@ -5497,16 +5942,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/outside_collaborators` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsConvertMemberToOutsideCollaborator( @@ -5518,7 +5968,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<202, EmptyObject> @@ -5529,14 +5979,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/outside_collaborators/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async orgsRemoveOutsideCollaborator( @@ -5545,7 +5994,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -5560,8 +6009,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/outside_collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesListPackagesForOrganization( @@ -5579,7 +6029,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_package[]> @@ -5589,6 +6039,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/packages` + const headers = this._headers({}, opts.headers) const query = this._query({ package_type: p["packageType"], visibility: p["visibility"], @@ -5596,7 +6047,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesGetPackageForOrganization( @@ -5612,13 +6067,14 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesDeletePackageForOrg( @@ -5634,7 +6090,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -5646,8 +6102,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesRestorePackageForOrg( @@ -5664,7 +6121,7 @@ export class ApiClient extends AbstractFetchClient { token?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -5676,11 +6133,12 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/restore` + const headers = this._headers({}, opts.headers) const query = this._query({ token: p["token"] }) return this._fetch( url + query, - { method: "POST", ...(opts ?? {}) }, + { method: "POST", ...opts, headers }, timeout, ) } @@ -5701,7 +6159,7 @@ export class ApiClient extends AbstractFetchClient { state?: "active" | "deleted" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_package_version[]> @@ -5713,13 +6171,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"], state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesGetPackageVersionForOrganization( @@ -5736,13 +6199,14 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesDeletePackageVersionForOrg( @@ -5759,7 +6223,7 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -5771,8 +6235,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesRestorePackageVersionForOrg( @@ -5789,7 +6254,7 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -5801,8 +6266,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}/restore` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async orgsListPatGrantRequests( @@ -5819,7 +6285,7 @@ export class ApiClient extends AbstractFetchClient { lastUsedAfter?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_programmatic_access_grant_request[]> @@ -5831,6 +6297,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/personal-access-token-requests` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -5843,7 +6310,11 @@ export class ApiClient extends AbstractFetchClient { last_used_after: p["lastUsedAfter"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsReviewPatGrantRequestsInBulk( @@ -5856,7 +6327,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5873,14 +6344,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/personal-access-token-requests` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsReviewPatGrantRequest( @@ -5893,7 +6363,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -5906,14 +6376,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/personal-access-token-requests/${p["patRequestId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsListPatGrantRequestRepositories( @@ -5924,7 +6393,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_minimal_repository[]> @@ -5936,9 +6405,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/personal-access-token-requests/${p["patRequestId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListPatGrants( @@ -5955,7 +6429,7 @@ export class ApiClient extends AbstractFetchClient { lastUsedAfter?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_programmatic_access_grant[]> @@ -5966,6 +6440,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/personal-access-tokens` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -5978,7 +6453,11 @@ export class ApiClient extends AbstractFetchClient { last_used_after: p["lastUsedAfter"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsUpdatePatAccesses( @@ -5990,7 +6469,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6006,14 +6485,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/personal-access-tokens` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsUpdatePatAccess( @@ -6025,7 +6503,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -6037,14 +6515,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/personal-access-tokens/${p["patId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsListPatGrantRepositories( @@ -6055,7 +6532,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_minimal_repository[]> @@ -6067,12 +6544,17 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/personal-access-tokens/${p["patId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) - } - - async projectsListForOrg( + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) + } + + async projectsListForOrg( p: { org: string state?: "open" | "closed" | "all" @@ -6080,20 +6562,25 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_project[]> | Res<422, t_validation_error_simple> > > { const url = this.basePath + `/orgs/${p["org"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async projectsCreateForOrg( @@ -6105,7 +6592,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_project> @@ -6117,14 +6604,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/projects` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async orgsGetAllCustomProperties( @@ -6132,7 +6618,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_custom_property[]> @@ -6141,8 +6627,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/properties/schema` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsCreateOrUpdateCustomProperties( @@ -6153,7 +6640,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_custom_property[]> @@ -6162,12 +6649,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/properties/schema` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -6178,7 +6668,7 @@ export class ApiClient extends AbstractFetchClient { customPropertyName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_custom_property> @@ -6189,8 +6679,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/properties/schema/${p["customPropertyName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsCreateOrUpdateCustomProperty( @@ -6206,7 +6697,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_custom_property> @@ -6217,14 +6708,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/properties/schema/${p["customPropertyName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async orgsRemoveCustomProperty( @@ -6233,7 +6723,7 @@ export class ApiClient extends AbstractFetchClient { customPropertyName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<404, t_basic_error> @@ -6242,8 +6732,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/properties/schema/${p["customPropertyName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async orgsListCustomPropertiesValuesForRepos( @@ -6254,7 +6745,7 @@ export class ApiClient extends AbstractFetchClient { repositoryQuery?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_repo_custom_property_values[]> @@ -6263,13 +6754,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/properties/values` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], repository_query: p["repositoryQuery"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsCreateOrUpdateCustomPropertiesValuesForRepos( @@ -6281,7 +6777,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -6291,12 +6787,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/properties/values` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -6308,12 +6807,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/public_members` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsCheckPublicMembershipForUser( @@ -6322,12 +6826,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/orgs/${p["org"]}/public_members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsSetPublicMembershipForAuthenticatedUser( @@ -6336,12 +6841,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<403, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/public_members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async orgsRemovePublicMembershipForAuthenticatedUser( @@ -6350,12 +6856,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/public_members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListForOrg( @@ -6368,9 +6875,10 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ type: p["type"], sort: p["sort"], @@ -6379,7 +6887,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateInOrg( @@ -6416,7 +6928,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_full_repository> @@ -6425,14 +6937,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/repos` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetOrgRulesets( @@ -6442,7 +6953,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_ruleset[]> @@ -6451,9 +6962,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/rulesets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateOrgRuleset( @@ -6469,7 +6985,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_repository_ruleset> @@ -6478,14 +6994,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/rulesets` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetOrgRuleSuites( @@ -6500,7 +7015,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_rule_suites> @@ -6509,6 +7024,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/rulesets/rule-suites` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], repository_name: p["repositoryName"], @@ -6519,7 +7035,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetOrgRuleSuite( @@ -6528,7 +7048,7 @@ export class ApiClient extends AbstractFetchClient { ruleSuiteId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_rule_suite> | Res<404, t_basic_error> | Res<500, t_basic_error> @@ -6537,8 +7057,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/rulesets/rule-suites/${p["ruleSuiteId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetOrgRuleset( @@ -6547,7 +7068,7 @@ export class ApiClient extends AbstractFetchClient { rulesetId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_ruleset> @@ -6556,8 +7077,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateOrgRuleset( @@ -6574,7 +7096,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_ruleset> @@ -6583,14 +7105,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/rulesets/${p["rulesetId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeleteOrgRuleset( @@ -6599,15 +7120,16 @@ export class ApiClient extends AbstractFetchClient { rulesetId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<500, t_basic_error> > > { const url = this.basePath + `/orgs/${p["org"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async secretScanningListAlertsForOrg( @@ -6625,7 +7147,7 @@ export class ApiClient extends AbstractFetchClient { validity?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_secret_scanning_alert[]> @@ -6641,6 +7163,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/secret-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], secret_type: p["secretType"], @@ -6654,7 +7177,11 @@ export class ApiClient extends AbstractFetchClient { validity: p["validity"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async securityAdvisoriesListOrgRepositoryAdvisories( @@ -6668,7 +7195,7 @@ export class ApiClient extends AbstractFetchClient { state?: "triage" | "draft" | "published" | "closed" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_advisory[]> @@ -6677,6 +7204,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/security-advisories` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], sort: p["sort"], @@ -6686,7 +7214,11 @@ export class ApiClient extends AbstractFetchClient { state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListSecurityManagerTeams( @@ -6694,11 +7226,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/security-managers` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsAddSecurityManagerTeam( @@ -6707,13 +7240,14 @@ export class ApiClient extends AbstractFetchClient { teamSlug: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/security-managers/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async orgsRemoveSecurityManagerTeam( @@ -6722,13 +7256,14 @@ export class ApiClient extends AbstractFetchClient { teamSlug: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/security-managers/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async billingGetGithubActionsBillingOrg( @@ -6736,11 +7271,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/settings/billing/actions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async billingGetGithubPackagesBillingOrg( @@ -6748,11 +7284,12 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/settings/billing/packages` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async billingGetSharedStorageBillingOrg( @@ -6760,12 +7297,13 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/settings/billing/shared-storage` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async copilotUsageMetricsForTeam( @@ -6778,7 +7316,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_copilot_usage_metrics[]> @@ -6790,6 +7328,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/orgs/${p["org"]}/team/${p["teamSlug"]}/copilot/usage` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], until: p["until"], @@ -6797,7 +7336,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsList( @@ -6807,12 +7350,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<403, t_basic_error>>> { const url = this.basePath + `/orgs/${p["org"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCreate( @@ -6832,7 +7380,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_team_full> @@ -6841,14 +7389,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async teamsGetByName( @@ -6857,13 +7404,14 @@ export class ApiClient extends AbstractFetchClient { teamSlug: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsUpdateInOrg( @@ -6882,7 +7430,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_team_full> @@ -6893,12 +7441,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -6909,11 +7460,12 @@ export class ApiClient extends AbstractFetchClient { teamSlug: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListDiscussionsInOrg( @@ -6926,10 +7478,11 @@ export class ApiClient extends AbstractFetchClient { pinned?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -6937,7 +7490,11 @@ export class ApiClient extends AbstractFetchClient { pinned: p["pinned"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCreateDiscussionInOrg( @@ -6951,18 +7508,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async teamsGetDiscussionInOrg( @@ -6972,13 +7528,14 @@ export class ApiClient extends AbstractFetchClient { discussionNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsUpdateDiscussionInOrg( @@ -6992,17 +7549,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -7014,13 +7574,14 @@ export class ApiClient extends AbstractFetchClient { discussionNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListDiscussionCommentsInOrg( @@ -7033,18 +7594,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCreateDiscussionCommentInOrg( @@ -7057,19 +7623,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async teamsGetDiscussionCommentInOrg( @@ -7080,13 +7645,14 @@ export class ApiClient extends AbstractFetchClient { commentNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsUpdateDiscussionCommentInOrg( @@ -7100,17 +7666,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -7123,13 +7692,14 @@ export class ApiClient extends AbstractFetchClient { commentNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForTeamDiscussionCommentInOrg( @@ -7151,18 +7721,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForTeamDiscussionCommentInOrg( @@ -7184,19 +7759,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<201, t_reaction>>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForTeamDiscussionComment( @@ -7208,13 +7782,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForTeamDiscussionInOrg( @@ -7235,18 +7810,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForTeamDiscussionInOrg( @@ -7267,19 +7847,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<201, t_reaction>>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForTeamDiscussion( @@ -7290,13 +7869,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/discussions/${p["discussionNumber"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListPendingInvitationsInOrg( @@ -7307,13 +7887,18 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsListMembersInOrg( @@ -7325,17 +7910,22 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/members` + const headers = this._headers({}, opts.headers) const query = this._query({ role: p["role"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsGetMembershipForUserInOrg( @@ -7345,13 +7935,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddOrUpdateMembershipForUserInOrg( @@ -7364,7 +7955,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_team_membership> | Res<403, void> | Res<422, void> @@ -7373,14 +7964,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/memberships/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async teamsRemoveMembershipForUserInOrg( @@ -7390,13 +7980,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<403, void>>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListProjectsInOrg( @@ -7407,13 +7998,18 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCheckPermissionsForProjectInOrg( @@ -7423,13 +8019,14 @@ export class ApiClient extends AbstractFetchClient { projectId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddOrUpdateProjectPermissionsInOrg( @@ -7442,7 +8039,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -7458,14 +8055,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects/${p["projectId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async teamsRemoveProjectInOrg( @@ -7475,13 +8071,14 @@ export class ApiClient extends AbstractFetchClient { projectId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListReposInOrg( @@ -7492,12 +8089,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCheckPermissionsForRepoInOrg( @@ -7508,7 +8110,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_team_repository> | Res<204, void> | Res<404, void> @@ -7517,8 +8119,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddOrUpdateRepoPermissionsInOrg( @@ -7532,19 +8135,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos/${p["owner"]}/${p["repo"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async teamsRemoveRepoInOrg( @@ -7555,13 +8157,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListChildInOrg( @@ -7572,12 +8175,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/orgs/${p["org"]}/teams/${p["teamSlug"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsEnableOrDisableSecurityProductOnAllOrgRepos( @@ -7597,19 +8205,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<422, void>>> { const url = this.basePath + `/orgs/${p["org"]}/${p["securityProduct"]}/${p["enablement"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async projectsGetCard( @@ -7617,7 +8224,7 @@ export class ApiClient extends AbstractFetchClient { cardId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_card> @@ -7628,8 +8235,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/cards/${p["cardId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async projectsUpdateCard( @@ -7641,7 +8249,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_card> @@ -7653,12 +8261,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/cards/${p["cardId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -7668,7 +8279,7 @@ export class ApiClient extends AbstractFetchClient { cardId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -7686,8 +8297,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/cards/${p["cardId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async projectsMoveCard( @@ -7699,7 +8311,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, EmptyObject> @@ -7734,14 +8346,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/cards/${p["cardId"]}/moves` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async projectsGetColumn( @@ -7749,7 +8360,7 @@ export class ApiClient extends AbstractFetchClient { columnId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_column> @@ -7760,8 +8371,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/${p["columnId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async projectsUpdateColumn( @@ -7772,7 +8384,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_column> @@ -7782,12 +8394,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/${p["columnId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -7797,7 +8412,7 @@ export class ApiClient extends AbstractFetchClient { columnId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -7807,8 +8422,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/${p["columnId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async projectsListCards( @@ -7819,7 +8435,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_card[]> @@ -7829,13 +8445,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/${p["columnId"]}/cards` + const headers = this._headers({}, opts.headers) const query = this._query({ archived_state: p["archivedState"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async projectsCreateCard( @@ -7851,7 +8472,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_project_card> @@ -7874,14 +8495,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/${p["columnId"]}/cards` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async projectsMoveColumn( @@ -7892,7 +8512,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, EmptyObject> @@ -7903,14 +8523,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/columns/${p["columnId"]}/moves` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async projectsGet( @@ -7918,7 +8537,7 @@ export class ApiClient extends AbstractFetchClient { projectId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project> @@ -7928,8 +8547,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async projectsUpdate( @@ -7944,7 +8564,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project> @@ -7964,12 +8584,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/${p["projectId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -7979,7 +8602,7 @@ export class ApiClient extends AbstractFetchClient { projectId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -7998,8 +8621,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async projectsListCollaborators( @@ -8010,7 +8634,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_simple_user[]> @@ -8022,13 +8646,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/${p["projectId"]}/collaborators` + const headers = this._headers({}, opts.headers) const query = this._query({ affiliation: p["affiliation"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async projectsAddCollaborator( @@ -8040,7 +8669,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -8054,14 +8683,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/projects/${p["projectId"]}/collaborators/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async projectsRemoveCollaborator( @@ -8070,7 +8698,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -8084,8 +8712,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/projects/${p["projectId"]}/collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async projectsGetPermissionForUser( @@ -8094,7 +8723,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_collaborator_permission> @@ -8108,8 +8737,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/projects/${p["projectId"]}/collaborators/${p["username"]}/permission` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async projectsListColumns( @@ -8119,7 +8749,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project_column[]> @@ -8129,9 +8759,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/${p["projectId"]}/columns` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async projectsCreateColumn( @@ -8142,7 +8777,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_project_column> @@ -8153,27 +8788,27 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/projects/${p["projectId"]}/columns` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async rateLimitGet( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_rate_limit_overview> | Res<304, void> | Res<404, t_basic_error> > > { const url = this.basePath + `/rate_limit` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGet( @@ -8182,7 +8817,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_full_repository> @@ -8192,8 +8827,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdate( @@ -8242,7 +8878,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_full_repository> @@ -8253,12 +8889,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -8269,7 +8908,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -8285,8 +8924,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListArtifactsForRepo( @@ -8298,7 +8938,7 @@ export class ApiClient extends AbstractFetchClient { name?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -8312,13 +8952,18 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], name: p["name"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetArtifact( @@ -8328,13 +8973,14 @@ export class ApiClient extends AbstractFetchClient { artifactId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts/${p["artifactId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsDeleteArtifact( @@ -8344,13 +8990,14 @@ export class ApiClient extends AbstractFetchClient { artifactId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts/${p["artifactId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsDownloadArtifact( @@ -8361,13 +9008,14 @@ export class ApiClient extends AbstractFetchClient { archiveFormat: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<410, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/artifacts/${p["artifactId"]}/${p["archiveFormat"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGetActionsCacheUsage( @@ -8376,14 +9024,15 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/cache/usage` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGetActionsCacheList( @@ -8398,10 +9047,11 @@ export class ApiClient extends AbstractFetchClient { direction?: "asc" | "desc" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/caches` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], @@ -8411,7 +9061,11 @@ export class ApiClient extends AbstractFetchClient { direction: p["direction"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsDeleteActionsCacheByKey( @@ -8422,15 +9076,16 @@ export class ApiClient extends AbstractFetchClient { ref?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/caches` + const headers = this._headers({}, opts.headers) const query = this._query({ key: p["key"], ref: p["ref"] }) return this._fetch( url + query, - { method: "DELETE", ...(opts ?? {}) }, + { method: "DELETE", ...opts, headers }, timeout, ) } @@ -8442,13 +9097,14 @@ export class ApiClient extends AbstractFetchClient { cacheId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/caches/${p["cacheId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsGetJobForWorkflowRun( @@ -8458,13 +9114,14 @@ export class ApiClient extends AbstractFetchClient { jobId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/jobs/${p["jobId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsDownloadJobLogsForWorkflowRun( @@ -8474,13 +9131,14 @@ export class ApiClient extends AbstractFetchClient { jobId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/jobs/${p["jobId"]}/logs` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsReRunJobForWorkflowRun( @@ -8493,21 +9151,20 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<403, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/jobs/${p["jobId"]}/rerun` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsGetCustomOidcSubClaimForRepo( @@ -8516,7 +9173,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_oidc_custom_sub_repo> @@ -8527,8 +9184,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/oidc/customization/sub` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetCustomOidcSubClaimForRepo( @@ -8541,7 +9199,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_empty_object> @@ -8553,14 +9211,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/oidc/customization/sub` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsListRepoOrganizationSecrets( @@ -8571,7 +9228,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -8586,9 +9243,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/organization-secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsListRepoOrganizationVariables( @@ -8599,7 +9261,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -8614,9 +9276,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/organization-variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetGithubActionsPermissionsRepository( @@ -8625,12 +9292,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetGithubActionsPermissionsRepository( @@ -8643,18 +9311,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsGetWorkflowAccessToRepository( @@ -8663,15 +9330,16 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/access` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetWorkflowAccessToRepository( @@ -8681,19 +9349,18 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_actions_workflow_access_to_repository }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/access` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsGetAllowedActionsRepository( @@ -8702,13 +9369,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/selected-actions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetAllowedActionsRepository( @@ -8718,19 +9386,18 @@ export class ApiClient extends AbstractFetchClient { requestBody?: t_selected_actions }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/selected-actions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsGetGithubActionsDefaultWorkflowPermissionsRepository( @@ -8739,15 +9406,16 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/workflow` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsSetGithubActionsDefaultWorkflowPermissionsRepository( @@ -8757,19 +9425,18 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_actions_set_default_workflow_permissions }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/permissions/workflow` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsListSelfHostedRunnersForRepo( @@ -8781,7 +9448,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -8795,13 +9462,18 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners` + const headers = this._headers({}, opts.headers) const query = this._query({ name: p["name"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsListRunnerApplicationsForRepo( @@ -8810,13 +9482,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/downloads` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGenerateRunnerJitconfigForRepo( @@ -8831,7 +9504,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -8848,14 +9521,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/generate-jitconfig` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsCreateRegistrationTokenForRepo( @@ -8864,13 +9536,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/registration-token` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsCreateRemoveTokenForRepo( @@ -8879,13 +9552,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/remove-token` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsGetSelfHostedRunnerForRepo( @@ -8895,13 +9569,14 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsDeleteSelfHostedRunnerFromRepo( @@ -8911,13 +9586,14 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListLabelsForSelfHostedRunnerForRepo( @@ -8927,7 +9603,7 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -8943,8 +9619,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsAddCustomLabelsToSelfHostedRunnerForRepo( @@ -8957,7 +9634,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -8974,14 +9651,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsSetCustomLabelsForSelfHostedRunnerForRepo( @@ -8994,7 +9670,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9011,14 +9687,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo( @@ -9028,7 +9703,7 @@ export class ApiClient extends AbstractFetchClient { runnerId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9044,8 +9719,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsRemoveCustomLabelFromSelfHostedRunnerForRepo( @@ -9056,7 +9732,7 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9073,8 +9749,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runners/${p["runnerId"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListWorkflowRunsForRepo( @@ -9107,7 +9784,7 @@ export class ApiClient extends AbstractFetchClient { headSha?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9120,6 +9797,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs` + const headers = this._headers({}, opts.headers) const query = this._query({ actor: p["actor"], branch: p["branch"], @@ -9133,7 +9811,11 @@ export class ApiClient extends AbstractFetchClient { head_sha: p["headSha"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetWorkflowRun( @@ -9144,16 +9826,21 @@ export class ApiClient extends AbstractFetchClient { excludePullRequests?: boolean }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude_pull_requests: p["excludePullRequests"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsDeleteWorkflowRun( @@ -9163,13 +9850,14 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsGetReviewsForRun( @@ -9179,13 +9867,14 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/approvals` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsApproveWorkflowRun( @@ -9195,7 +9884,7 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_empty_object> @@ -9206,8 +9895,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/approve` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsListWorkflowRunArtifacts( @@ -9220,7 +9910,7 @@ export class ApiClient extends AbstractFetchClient { name?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9235,13 +9925,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/artifacts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], name: p["name"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetWorkflowRunAttempt( @@ -9253,16 +9948,21 @@ export class ApiClient extends AbstractFetchClient { excludePullRequests?: boolean }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/attempts/${p["attemptNumber"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude_pull_requests: p["excludePullRequests"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsListJobsForWorkflowRunAttempt( @@ -9275,7 +9975,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9291,9 +9991,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/attempts/${p["attemptNumber"]}/jobs` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsDownloadWorkflowRunAttemptLogs( @@ -9304,13 +10009,14 @@ export class ApiClient extends AbstractFetchClient { attemptNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/attempts/${p["attemptNumber"]}/logs` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsCancelWorkflowRun( @@ -9320,15 +10026,16 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<409, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/cancel` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsReviewCustomGatesForRun( @@ -9341,19 +10048,18 @@ export class ApiClient extends AbstractFetchClient { | t_review_custom_gates_state_required }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/deployment_protection_rule` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsForceCancelWorkflowRun( @@ -9363,15 +10069,16 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<409, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/force-cancel` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async actionsListJobsForWorkflowRun( @@ -9384,7 +10091,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9399,13 +10106,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/jobs` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsDownloadWorkflowRunLogs( @@ -9415,13 +10127,14 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/logs` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsDeleteWorkflowRunLogs( @@ -9431,7 +10144,7 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<500, t_basic_error> @@ -9440,8 +10153,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/logs` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsGetPendingDeploymentsForRun( @@ -9451,13 +10165,14 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/pending_deployments` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsReviewPendingDeploymentsForRun( @@ -9472,19 +10187,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/pending_deployments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsReRunWorkflow( @@ -9497,19 +10211,18 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/rerun` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsReRunWorkflowFailedJobs( @@ -9522,19 +10235,18 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/rerun-failed-jobs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsGetWorkflowRunUsage( @@ -9544,13 +10256,14 @@ export class ApiClient extends AbstractFetchClient { runId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/runs/${p["runId"]}/timing` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsListRepoSecrets( @@ -9561,7 +10274,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9575,9 +10288,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetRepoPublicKey( @@ -9586,13 +10304,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGetRepoSecret( @@ -9602,13 +10321,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsCreateOrUpdateRepoSecret( @@ -9622,19 +10342,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<204, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsDeleteRepoSecret( @@ -9644,13 +10363,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListRepoVariables( @@ -9661,7 +10381,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9675,9 +10395,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsCreateRepoVariable( @@ -9690,18 +10415,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/variables` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsGetRepoVariable( @@ -9711,13 +10435,14 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsUpdateRepoVariable( @@ -9731,17 +10456,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/variables/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -9753,13 +10481,14 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListRepoWorkflows( @@ -9770,7 +10499,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9784,9 +10513,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetWorkflow( @@ -9796,13 +10530,14 @@ export class ApiClient extends AbstractFetchClient { workflowId: number | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsDisableWorkflow( @@ -9812,13 +10547,14 @@ export class ApiClient extends AbstractFetchClient { workflowId: number | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/disable` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async actionsCreateWorkflowDispatch( @@ -9834,19 +10570,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/dispatches` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsEnableWorkflow( @@ -9856,13 +10591,14 @@ export class ApiClient extends AbstractFetchClient { workflowId: number | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/enable` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async actionsListWorkflowRuns( @@ -9896,7 +10632,7 @@ export class ApiClient extends AbstractFetchClient { headSha?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -9911,6 +10647,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/runs` + const headers = this._headers({}, opts.headers) const query = this._query({ actor: p["actor"], branch: p["branch"], @@ -9924,7 +10661,11 @@ export class ApiClient extends AbstractFetchClient { head_sha: p["headSha"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetWorkflowUsage( @@ -9934,13 +10675,14 @@ export class ApiClient extends AbstractFetchClient { workflowId: number | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/actions/workflows/${p["workflowId"]}/timing` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposListActivities( @@ -9963,13 +10705,14 @@ export class ApiClient extends AbstractFetchClient { | "merge_queue_merge" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_activity[]> | Res<422, t_validation_error_simple> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/activity` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], @@ -9981,7 +10724,11 @@ export class ApiClient extends AbstractFetchClient { activity_type: p["activityType"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesListAssignees( @@ -9992,14 +10739,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/assignees` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesCheckUserCanBeAssigned( @@ -10009,13 +10761,14 @@ export class ApiClient extends AbstractFetchClient { assignee: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/assignees/${p["assignee"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateAttestation( @@ -10035,7 +10788,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10049,14 +10802,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/attestations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposListAttestations( @@ -10069,7 +10821,7 @@ export class ApiClient extends AbstractFetchClient { subjectDigest: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -10094,13 +10846,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/attestations/${p["subjectDigest"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], after: p["after"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListAutolinks( @@ -10109,11 +10866,12 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/autolinks` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateAutolink( @@ -10127,19 +10885,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/autolinks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetAutolink( @@ -10149,15 +10906,16 @@ export class ApiClient extends AbstractFetchClient { autolinkId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/autolinks/${p["autolinkId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposDeleteAutolink( @@ -10167,13 +10925,14 @@ export class ApiClient extends AbstractFetchClient { autolinkId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/autolinks/${p["autolinkId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposCheckAutomatedSecurityFixes( @@ -10182,7 +10941,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_check_automated_security_fixes> | Res<404, void> @@ -10191,8 +10950,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/automated-security-fixes` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposEnableAutomatedSecurityFixes( @@ -10201,13 +10961,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/automated-security-fixes` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async reposDisableAutomatedSecurityFixes( @@ -10216,13 +10977,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/automated-security-fixes` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListBranches( @@ -10234,18 +10996,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches` + const headers = this._headers({}, opts.headers) const query = this._query({ protected: p["protected"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetBranch( @@ -10255,7 +11022,7 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_branch_with_protection> @@ -10266,8 +11033,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetBranchProtection( @@ -10277,15 +11045,16 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateBranchProtection( @@ -10334,7 +11103,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_protected_branch> @@ -10346,14 +11115,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeleteBranchProtection( @@ -10363,13 +11131,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<403, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetAdminBranchProtection( @@ -10379,13 +11148,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/enforce_admins` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposSetAdminBranchProtection( @@ -10395,13 +11165,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/enforce_admins` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async reposDeleteAdminBranchProtection( @@ -10411,13 +11182,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/enforce_admins` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetPullRequestReviewProtection( @@ -10427,15 +11199,16 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_pull_request_reviews` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdatePullRequestReviewProtection( @@ -10461,7 +11234,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_protected_branch_pull_request_review> @@ -10471,12 +11244,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_pull_request_reviews` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -10488,13 +11264,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_pull_request_reviews` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetCommitSignatureProtection( @@ -10504,7 +11281,7 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_protected_branch_admin_enforced> | Res<404, t_basic_error> @@ -10513,8 +11290,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_signatures` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateCommitSignatureProtection( @@ -10524,7 +11302,7 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_protected_branch_admin_enforced> | Res<404, t_basic_error> @@ -10533,8 +11311,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_signatures` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async reposDeleteCommitSignatureProtection( @@ -10544,13 +11323,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_signatures` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetStatusChecksProtection( @@ -10560,7 +11340,7 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_status_check_policy> | Res<404, t_basic_error> @@ -10569,8 +11349,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateStatusCheckProtection( @@ -10588,7 +11369,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_status_check_policy> @@ -10599,12 +11380,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -10616,13 +11400,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetAllStatusCheckContexts( @@ -10632,13 +11417,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposAddStatusCheckContexts( @@ -10653,7 +11439,7 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, string[]> @@ -10665,14 +11451,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposSetStatusCheckContexts( @@ -10687,7 +11472,7 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, string[]> @@ -10698,14 +11483,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposRemoveStatusCheckContexts( @@ -10720,7 +11504,7 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, string[]> @@ -10731,12 +11515,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/required_status_checks/contexts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -10748,7 +11535,7 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_branch_restriction_policy> | Res<404, t_basic_error> @@ -10757,8 +11544,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposDeleteAccessRestrictions( @@ -10768,13 +11556,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetAppsWithAccessToProtectedBranch( @@ -10784,15 +11573,16 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposAddAppAccessRestrictions( @@ -10807,21 +11597,20 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposSetAppAccessRestrictions( @@ -10836,21 +11625,20 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposRemoveAppAccessRestrictions( @@ -10865,19 +11653,22 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/apps` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -10889,13 +11680,14 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposAddTeamAccessRestrictions( @@ -10910,21 +11702,20 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposSetTeamAccessRestrictions( @@ -10939,21 +11730,20 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposRemoveTeamAccessRestrictions( @@ -10968,19 +11758,22 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/teams` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -10992,15 +11785,16 @@ export class ApiClient extends AbstractFetchClient { branch: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposAddUserAccessRestrictions( @@ -11015,21 +11809,20 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposSetUserAccessRestrictions( @@ -11044,21 +11837,20 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposRemoveUserAccessRestrictions( @@ -11073,19 +11865,22 @@ export class ApiClient extends AbstractFetchClient { | string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/protection/restrictions/users` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -11100,7 +11895,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_branch_with_protection> @@ -11112,14 +11907,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/branches/${p["branch"]}/rename` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async checksCreate( @@ -11137,17 +11931,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-runs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async checksGet( @@ -11157,13 +11950,14 @@ export class ApiClient extends AbstractFetchClient { checkRunId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async checksUpdate( @@ -11222,17 +12016,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -11246,14 +12043,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}/annotations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async checksRerequestRun( @@ -11263,7 +12065,7 @@ export class ApiClient extends AbstractFetchClient { checkRunId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_empty_object> @@ -11275,8 +12077,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-runs/${p["checkRunId"]}/rerequest` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async checksCreateSuite( @@ -11288,19 +12091,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<201, t_check_suite>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-suites` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async checksSetSuitesPreferences( @@ -11315,17 +12117,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-suites/preferences` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -11337,13 +12142,14 @@ export class ApiClient extends AbstractFetchClient { checkSuiteId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-suites/${p["checkSuiteId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async checksListForSuite( @@ -11358,7 +12164,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -11373,6 +12179,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-suites/${p["checkSuiteId"]}/check-runs` + const headers = this._headers({}, opts.headers) const query = this._query({ check_name: p["checkName"], status: p["status"], @@ -11381,7 +12188,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async checksRerequestSuite( @@ -11391,13 +12202,14 @@ export class ApiClient extends AbstractFetchClient { checkSuiteId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/check-suites/${p["checkSuiteId"]}/rerequest` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async codeScanningListAlertsForRepo( @@ -11415,7 +12227,7 @@ export class ApiClient extends AbstractFetchClient { severity?: t_code_scanning_alert_severity }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_alert_items[]> @@ -11434,6 +12246,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ tool_name: p["toolName"], tool_guid: p["toolGuid"], @@ -11446,7 +12259,11 @@ export class ApiClient extends AbstractFetchClient { severity: p["severity"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codeScanningGetAlert( @@ -11456,7 +12273,7 @@ export class ApiClient extends AbstractFetchClient { alertNumber: t_alert_number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_alert> @@ -11476,8 +12293,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts/${p["alertNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningUpdateAlert( @@ -11492,7 +12310,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_alert> @@ -11511,12 +12329,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts/${p["alertNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -11531,7 +12352,7 @@ export class ApiClient extends AbstractFetchClient { ref?: t_code_scanning_ref }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_alert_instance[]> @@ -11550,13 +12371,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/alerts/${p["alertNumber"]}/instances` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"], ref: p["ref"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codeScanningListRecentAnalyses( @@ -11573,7 +12399,7 @@ export class ApiClient extends AbstractFetchClient { sort?: "created" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_analysis[]> @@ -11591,6 +12417,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/analyses` + const headers = this._headers({}, opts.headers) const query = this._query({ tool_name: p["toolName"], tool_guid: p["toolGuid"], @@ -11602,7 +12429,11 @@ export class ApiClient extends AbstractFetchClient { sort: p["sort"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codeScanningGetAnalysis( @@ -11612,7 +12443,7 @@ export class ApiClient extends AbstractFetchClient { analysisId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -11636,8 +12467,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/analyses/${p["analysisId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningDeleteAnalysis( @@ -11648,7 +12480,7 @@ export class ApiClient extends AbstractFetchClient { confirmDelete?: string | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_analysis_deletion> @@ -11668,11 +12500,12 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/analyses/${p["analysisId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ confirm_delete: p["confirmDelete"] }) return this._fetch( url + query, - { method: "DELETE", ...(opts ?? {}) }, + { method: "DELETE", ...opts, headers }, timeout, ) } @@ -11683,7 +12516,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_codeql_database[]> @@ -11702,8 +12535,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/databases` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningGetCodeqlDatabase( @@ -11713,7 +12547,7 @@ export class ApiClient extends AbstractFetchClient { language: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_codeql_database> @@ -11733,8 +12567,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/databases/${p["language"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningCreateVariantAnalysis( @@ -11744,7 +12579,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_code_scanning_variant_analysis> @@ -11763,14 +12598,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/variant-analyses` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codeScanningGetVariantAnalysis( @@ -11780,7 +12614,7 @@ export class ApiClient extends AbstractFetchClient { codeqlVariantAnalysisId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_variant_analysis> @@ -11798,8 +12632,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/variant-analyses/${p["codeqlVariantAnalysisId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningGetVariantAnalysisRepoTask( @@ -11811,7 +12646,7 @@ export class ApiClient extends AbstractFetchClient { repoName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_variant_analysis_repo_task> @@ -11829,8 +12664,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/codeql/variant-analyses/${p["codeqlVariantAnalysisId"]}/repos/${p["repoOwner"]}/${p["repoName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningGetDefaultSetup( @@ -11839,7 +12675,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_default_setup> @@ -11858,8 +12694,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/default-setup` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeScanningUpdateDefaultSetup( @@ -11869,7 +12706,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_code_scanning_default_setup_update }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_empty_object> @@ -11890,12 +12727,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/default-setup` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -11915,7 +12755,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<202, t_code_scanning_sarifs_receipt> @@ -11935,14 +12775,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/sarifs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codeScanningGetSarif( @@ -11952,7 +12791,7 @@ export class ApiClient extends AbstractFetchClient { sarifId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_scanning_sarifs_status> @@ -11971,8 +12810,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-scanning/sarifs/${p["sarifId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codeSecurityGetConfigurationForRepository( @@ -11981,7 +12821,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_security_configuration_for_repository> @@ -11994,8 +12834,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/code-security-configuration` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCodeownersErrors( @@ -12005,15 +12846,20 @@ export class ApiClient extends AbstractFetchClient { ref?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, void>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codeowners/errors` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesListInRepositoryForAuthenticatedUser( @@ -12024,7 +12870,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -12041,9 +12887,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesCreateWithRepoForAuthenticatedUser( @@ -12065,7 +12916,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_codespace> @@ -12085,14 +12936,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codespacesListDevcontainersInRepositoryForAuthenticatedUser( @@ -12103,7 +12953,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -12127,9 +12977,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/devcontainers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesRepoMachinesForAuthenticatedUser( @@ -12141,7 +12996,7 @@ export class ApiClient extends AbstractFetchClient { ref?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -12160,13 +13015,18 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/machines` + const headers = this._headers({}, opts.headers) const query = this._query({ location: p["location"], client_ip: p["clientIp"], ref: p["ref"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesPreFlightWithRepoForAuthenticatedUser( @@ -12177,7 +13037,7 @@ export class ApiClient extends AbstractFetchClient { clientIp?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -12197,9 +13057,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/new` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], client_ip: p["clientIp"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesCheckPermissionsForDevcontainer( @@ -12210,7 +13075,7 @@ export class ApiClient extends AbstractFetchClient { devcontainerPath: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_codespaces_permissions_check_for_devcontainer> @@ -12231,12 +13096,17 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/permissions_check` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], devcontainer_path: p["devcontainerPath"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesListRepoSecrets( @@ -12247,7 +13117,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -12261,9 +13131,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesGetRepoPublicKey( @@ -12272,13 +13147,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesGetRepoSecret( @@ -12288,13 +13164,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesCreateOrUpdateRepoSecret( @@ -12308,19 +13185,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<204, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codespacesDeleteRepoSecret( @@ -12330,13 +13206,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListCollaborators( @@ -12349,12 +13226,13 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/collaborators` + const headers = this._headers({}, opts.headers) const query = this._query({ affiliation: p["affiliation"], permission: p["permission"], @@ -12362,7 +13240,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCheckCollaborator( @@ -12372,13 +13254,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposAddCollaborator( @@ -12391,7 +13274,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_repository_invitation> @@ -12403,14 +13286,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposRemoveCollaborator( @@ -12420,7 +13302,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<422, t_validation_error> @@ -12429,8 +13311,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetCollaboratorPermissionLevel( @@ -12440,7 +13323,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_repository_collaborator_permission> | Res<404, t_basic_error> @@ -12449,8 +13332,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/collaborators/${p["username"]}/permission` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposListCommitCommentsForRepo( @@ -12461,12 +13345,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetCommitComment( @@ -12476,15 +13365,16 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateCommitComment( @@ -12497,19 +13387,22 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -12521,13 +13414,14 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForCommitComment( @@ -12548,20 +13442,25 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForCommitComment( @@ -12582,7 +13481,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reaction> | Res<201, t_reaction> | Res<422, t_validation_error> @@ -12591,14 +13490,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForCommitComment( @@ -12609,13 +13507,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/comments/${p["commentId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListCommits( @@ -12632,7 +13531,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_commit[]> @@ -12643,6 +13542,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ sha: p["sha"], path: p["path"], @@ -12654,7 +13554,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListBranchesForHeadCommit( @@ -12664,7 +13568,7 @@ export class ApiClient extends AbstractFetchClient { commitSha: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_branch_short[]> @@ -12675,8 +13579,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/branches-where-head` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposListCommentsForCommit( @@ -12688,14 +13593,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateCommitComment( @@ -12711,7 +13621,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_commit_comment> @@ -12722,14 +13632,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposListPullRequestsAssociatedWithCommit( @@ -12741,7 +13650,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_pull_request_simple[]> | Res<409, t_basic_error> @@ -12750,9 +13659,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["commitSha"]}/pulls` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetCommit( @@ -12764,7 +13678,7 @@ export class ApiClient extends AbstractFetchClient { ref: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_commit> @@ -12784,9 +13698,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async checksListForRef( @@ -12802,7 +13721,7 @@ export class ApiClient extends AbstractFetchClient { appId?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -12817,6 +13736,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/check-runs` + const headers = this._headers({}, opts.headers) const query = this._query({ check_name: p["checkName"], status: p["status"], @@ -12826,7 +13746,11 @@ export class ApiClient extends AbstractFetchClient { app_id: p["appId"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async checksListSuitesForRef( @@ -12840,7 +13764,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -12855,6 +13779,7 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/check-suites` + const headers = this._headers({}, opts.headers) const query = this._query({ app_id: p["appId"], check_name: p["checkName"], @@ -12862,7 +13787,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetCombinedStatusForRef( @@ -12874,7 +13803,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_combined_commit_status> | Res<404, t_basic_error> @@ -12883,9 +13812,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/status` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListCommitStatusesForRef( @@ -12897,16 +13831,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<301, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/commits/${p["ref"]}/statuses` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetCommunityProfileMetrics( @@ -12915,12 +13854,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/community/profile` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCompareCommits( @@ -12932,7 +13872,7 @@ export class ApiClient extends AbstractFetchClient { basehead: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_commit_comparison> @@ -12951,9 +13891,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/compare/${p["basehead"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetContent( @@ -12964,7 +13909,7 @@ export class ApiClient extends AbstractFetchClient { ref?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -12982,9 +13927,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/contents/${p["path"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateOrUpdateFileContents( @@ -13010,7 +13960,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_file_commit> @@ -13022,14 +13972,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/contents/${p["path"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeleteFile( @@ -13052,7 +14001,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_file_commit> @@ -13071,12 +14020,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/contents/${p["path"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -13090,7 +14042,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_contributor[]> @@ -13100,13 +14052,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/contributors` + const headers = this._headers({}, opts.headers) const query = this._query({ anon: p["anon"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotListAlertsForRepo( @@ -13129,7 +14086,7 @@ export class ApiClient extends AbstractFetchClient { last?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependabot_alert[]> @@ -13142,6 +14099,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], severity: p["severity"], @@ -13159,7 +14117,11 @@ export class ApiClient extends AbstractFetchClient { last: p["last"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotGetAlert( @@ -13169,7 +14131,7 @@ export class ApiClient extends AbstractFetchClient { alertNumber: t_alert_number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependabot_alert> @@ -13181,8 +14143,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/alerts/${p["alertNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async dependabotUpdateAlert( @@ -13202,7 +14165,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependabot_alert> @@ -13216,12 +14179,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/alerts/${p["alertNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -13234,7 +14200,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13248,9 +14214,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependabotGetRepoPublicKey( @@ -13259,13 +14230,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async dependabotGetRepoSecret( @@ -13275,13 +14247,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async dependabotCreateOrUpdateRepoSecret( @@ -13295,19 +14268,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<204, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async dependabotDeleteRepoSecret( @@ -13317,13 +14289,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependabot/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async dependencyGraphDiffRange( @@ -13334,7 +14307,7 @@ export class ApiClient extends AbstractFetchClient { name?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependency_graph_diff> @@ -13345,9 +14318,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependency-graph/compare/${p["basehead"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ name: p["name"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async dependencyGraphExportSbom( @@ -13356,7 +14334,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_dependency_graph_spdx_sbom> @@ -13366,8 +14344,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependency-graph/sbom` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async dependencyGraphCreateRepositorySnapshot( @@ -13377,7 +14356,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_snapshot }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13394,14 +14373,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dependency-graph/snapshots` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposListDeployments( @@ -13416,9 +14394,10 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments` + const headers = this._headers({}, opts.headers) const query = this._query({ sha: p["sha"], ref: p["ref"], @@ -13428,7 +14407,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateDeployment( @@ -13452,7 +14435,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_deployment> @@ -13467,14 +14450,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetDeployment( @@ -13484,15 +14466,16 @@ export class ApiClient extends AbstractFetchClient { deploymentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposDeleteDeployment( @@ -13502,7 +14485,7 @@ export class ApiClient extends AbstractFetchClient { deploymentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -13513,8 +14496,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListDeploymentStatuses( @@ -13526,7 +14510,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deployment_status[]> | Res<404, t_basic_error> @@ -13535,9 +14519,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}/statuses` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateDeploymentStatus( @@ -13563,7 +14552,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<201, t_deployment_status> | Res<422, t_validation_error> @@ -13572,14 +14561,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}/statuses` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetDeploymentStatus( @@ -13590,15 +14578,16 @@ export class ApiClient extends AbstractFetchClient { statusId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/deployments/${p["deploymentId"]}/statuses/${p["statusId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateDispatchEvent( @@ -13613,21 +14602,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<422, t_validation_error> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/dispatches` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetAllEnvironments( @@ -13638,7 +14626,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13651,9 +14639,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetEnvironment( @@ -13663,13 +14656,14 @@ export class ApiClient extends AbstractFetchClient { environmentName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateOrUpdateEnvironment( @@ -13690,21 +14684,20 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeleteAnEnvironment( @@ -13714,13 +14707,14 @@ export class ApiClient extends AbstractFetchClient { environmentName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListDeploymentBranchPolicies( @@ -13732,7 +14726,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13747,9 +14741,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateDeploymentBranchPolicy( @@ -13760,7 +14759,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_deployment_branch_policy_name_pattern_with_type }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deployment_branch_policy> | Res<303, void> | Res<404, void> @@ -13769,14 +14768,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetDeploymentBranchPolicy( @@ -13787,13 +14785,14 @@ export class ApiClient extends AbstractFetchClient { branchPolicyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies/${p["branchPolicyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateDeploymentBranchPolicy( @@ -13805,19 +14804,18 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_deployment_branch_policy_name_pattern }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies/${p["branchPolicyId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeleteDeploymentBranchPolicy( @@ -13828,13 +14826,14 @@ export class ApiClient extends AbstractFetchClient { branchPolicyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment-branch-policies/${p["branchPolicyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetAllDeploymentProtectionRules( @@ -13844,7 +14843,7 @@ export class ApiClient extends AbstractFetchClient { owner: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13859,8 +14858,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateDeploymentProtectionRule( @@ -13873,19 +14873,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposListCustomDeploymentRuleIntegrations( @@ -13897,7 +14896,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13912,9 +14911,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules/apps` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetCustomDeploymentProtectionRule( @@ -13925,13 +14929,14 @@ export class ApiClient extends AbstractFetchClient { protectionRuleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules/${p["protectionRuleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposDisableDeploymentProtectionRule( @@ -13942,13 +14947,14 @@ export class ApiClient extends AbstractFetchClient { protectionRuleId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/deployment_protection_rules/${p["protectionRuleId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListEnvironmentSecrets( @@ -13960,7 +14966,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -13975,9 +14981,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsGetEnvironmentPublicKey( @@ -13987,13 +14998,14 @@ export class ApiClient extends AbstractFetchClient { environmentName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsGetEnvironmentSecret( @@ -14004,13 +15016,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsCreateOrUpdateEnvironmentSecret( @@ -14025,19 +15038,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<204, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async actionsDeleteEnvironmentSecret( @@ -14048,13 +15060,14 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async actionsListEnvironmentVariables( @@ -14066,7 +15079,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -14081,9 +15094,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async actionsCreateEnvironmentVariable( @@ -14097,19 +15115,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async actionsGetEnvironmentVariable( @@ -14120,13 +15137,14 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async actionsUpdateEnvironmentVariable( @@ -14141,17 +15159,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -14164,13 +15185,14 @@ export class ApiClient extends AbstractFetchClient { environmentName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/environments/${p["environmentName"]}/variables/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async activityListRepoEvents( @@ -14181,12 +15203,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListForks( @@ -14198,20 +15225,25 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_minimal_repository[]> | Res<400, t_scim_error> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/forks` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateFork( @@ -14225,7 +15257,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<202, t_full_repository> @@ -14236,14 +15268,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/forks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gitCreateBlob( @@ -14256,7 +15287,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_short_blob> @@ -14267,14 +15298,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/blobs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gitGetBlob( @@ -14284,7 +15314,7 @@ export class ApiClient extends AbstractFetchClient { fileSha: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_blob> @@ -14297,8 +15327,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/blobs/${p["fileSha"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitCreateCommit( @@ -14323,7 +15354,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_git_commit> @@ -14333,14 +15364,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/commits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gitGetCommit( @@ -14350,7 +15380,7 @@ export class ApiClient extends AbstractFetchClient { commitSha: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_git_commit> | Res<404, t_basic_error> | Res<409, t_basic_error> @@ -14359,8 +15389,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/commits/${p["commitSha"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitListMatchingRefs( @@ -14370,15 +15401,16 @@ export class ApiClient extends AbstractFetchClient { ref: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<409, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/matching-refs/${p["ref"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitGetRef( @@ -14388,7 +15420,7 @@ export class ApiClient extends AbstractFetchClient { ref: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_git_ref> | Res<404, t_basic_error> | Res<409, t_basic_error> @@ -14396,8 +15428,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/ref/${p["ref"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitCreateRef( @@ -14410,7 +15443,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_git_ref> @@ -14419,14 +15452,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/refs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gitUpdateRef( @@ -14440,7 +15472,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_git_ref> @@ -14450,12 +15482,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/refs/${p["ref"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -14467,7 +15502,7 @@ export class ApiClient extends AbstractFetchClient { ref: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<409, t_basic_error> | Res<422, t_validation_error> @@ -14475,8 +15510,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/refs/${p["ref"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async gitCreateTag( @@ -14496,7 +15532,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_git_tag> @@ -14505,14 +15541,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/tags` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gitGetTag( @@ -14522,7 +15557,7 @@ export class ApiClient extends AbstractFetchClient { tagSha: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_git_tag> | Res<404, t_basic_error> | Res<409, t_basic_error> @@ -14531,8 +15566,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/tags/${p["tagSha"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gitCreateTree( @@ -14551,7 +15587,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_git_tree> @@ -14562,14 +15598,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/trees` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async gitGetTree( @@ -14580,7 +15615,7 @@ export class ApiClient extends AbstractFetchClient { recursive?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_git_tree> @@ -14592,9 +15627,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/git/trees/${p["treeSha"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ recursive: p["recursive"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListWebhooks( @@ -14605,12 +15645,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateWebhook( @@ -14630,7 +15675,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_hook> @@ -14640,14 +15685,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetWebhook( @@ -14657,12 +15701,13 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateWebhook( @@ -14679,7 +15724,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_hook> | Res<404, t_basic_error> | Res<422, t_validation_error> @@ -14687,12 +15732,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -14704,12 +15752,13 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetWebhookConfigForRepo( @@ -14719,13 +15768,14 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/config` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateWebhookConfigForRepo( @@ -14741,17 +15791,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/config` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -14766,7 +15819,7 @@ export class ApiClient extends AbstractFetchClient { redelivery?: boolean }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hook_delivery_item[]> @@ -14777,13 +15830,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/deliveries` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], cursor: p["cursor"], redelivery: p["redelivery"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetWebhookDelivery( @@ -14794,7 +15852,7 @@ export class ApiClient extends AbstractFetchClient { deliveryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hook_delivery> @@ -14805,8 +15863,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposRedeliverWebhookDelivery( @@ -14817,7 +15876,7 @@ export class ApiClient extends AbstractFetchClient { deliveryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -14833,8 +15892,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/deliveries/${p["deliveryId"]}/attempts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async reposPingWebhook( @@ -14844,13 +15904,14 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/pings` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async reposTestPushWebhook( @@ -14860,13 +15921,14 @@ export class ApiClient extends AbstractFetchClient { hookId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/hooks/${p["hookId"]}/tests` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async migrationsGetImportStatus( @@ -14875,15 +15937,16 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_import> | Res<404, t_basic_error> | Res<503, t_basic_error> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async migrationsStartImport( @@ -14899,7 +15962,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_import> @@ -14909,14 +15972,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async migrationsUpdateImport( @@ -14931,15 +15993,18 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<503, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -14950,11 +16015,12 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<503, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async migrationsGetCommitAuthors( @@ -14964,7 +16030,7 @@ export class ApiClient extends AbstractFetchClient { since?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_porter_author[]> @@ -14974,9 +16040,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import/authors` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async migrationsMapCommitAuthor( @@ -14990,7 +16061,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_porter_author> @@ -15002,12 +16073,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import/authors/${p["authorId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -15018,7 +16092,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_porter_large_file[]> | Res<503, t_basic_error> @@ -15026,8 +16100,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import/large_files` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async migrationsSetLfsPreference( @@ -15039,7 +16114,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_import> @@ -15048,12 +16123,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/import/lfs` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -15064,7 +16142,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_installation> @@ -15073,8 +16151,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/installation` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async interactionsGetRestrictionsForRepo( @@ -15083,14 +16162,15 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/interaction-limits` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async interactionsSetRestrictionsForRepo( @@ -15100,20 +16180,19 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_interaction_limit }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<409, void>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/interaction-limits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async interactionsRemoveRestrictionsForRepo( @@ -15122,12 +16201,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<409, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/interaction-limits` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListInvitations( @@ -15138,12 +16218,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposUpdateInvitation( @@ -15156,17 +16241,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/invitations/${p["invitationId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -15178,13 +16266,14 @@ export class ApiClient extends AbstractFetchClient { invitationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesListForRepo( @@ -15204,7 +16293,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue[]> @@ -15214,6 +16303,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ milestone: p["milestone"], state: p["state"], @@ -15228,7 +16318,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesCreate( @@ -15253,7 +16347,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_issue> @@ -15273,14 +16367,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesListCommentsForRepo( @@ -15294,7 +16387,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue_comment[]> @@ -15304,6 +16397,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -15312,7 +16406,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesGetComment( @@ -15322,15 +16420,16 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async issuesUpdateComment( @@ -15343,19 +16442,22 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -15367,13 +16469,14 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForIssueComment( @@ -15394,20 +16497,25 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForIssueComment( @@ -15428,7 +16536,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reaction> | Res<201, t_reaction> | Res<422, t_validation_error> @@ -15437,14 +16545,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForIssueComment( @@ -15455,13 +16562,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/comments/${p["commentId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesListEventsForRepo( @@ -15472,15 +16580,20 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesGetEvent( @@ -15490,7 +16603,7 @@ export class ApiClient extends AbstractFetchClient { eventId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue_event> @@ -15502,8 +16615,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/events/${p["eventId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async issuesGet( @@ -15513,7 +16627,7 @@ export class ApiClient extends AbstractFetchClient { issueNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue> @@ -15526,8 +16640,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async issuesUpdate( @@ -15555,7 +16670,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue> @@ -15577,12 +16692,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -15597,19 +16715,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/assignees` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesRemoveAssignees( @@ -15622,17 +16739,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/assignees` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -15645,13 +16765,14 @@ export class ApiClient extends AbstractFetchClient { assignee: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/assignees/${p["assignee"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async issuesListComments( @@ -15664,7 +16785,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_issue_comment[]> @@ -15675,13 +16796,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesCreateComment( @@ -15694,7 +16820,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_issue_comment> @@ -15707,14 +16833,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesListEvents( @@ -15726,7 +16851,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issue_event_for_issue[]> | Res<410, t_basic_error> @@ -15735,9 +16860,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesListLabelsOnIssue( @@ -15749,7 +16879,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_label[]> @@ -15761,9 +16891,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesAddLabels( @@ -15787,7 +16922,7 @@ export class ApiClient extends AbstractFetchClient { | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_label[]> @@ -15800,14 +16935,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesSetLabels( @@ -15831,7 +16965,7 @@ export class ApiClient extends AbstractFetchClient { | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_label[]> @@ -15844,14 +16978,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async issuesRemoveAllLabels( @@ -15861,7 +16994,7 @@ export class ApiClient extends AbstractFetchClient { issueNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -15873,8 +17006,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesRemoveLabel( @@ -15885,7 +17019,7 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_label[]> @@ -15897,8 +17031,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesLock( @@ -15911,7 +17046,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -15924,14 +17059,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/lock` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async issuesUnlock( @@ -15941,7 +17075,7 @@ export class ApiClient extends AbstractFetchClient { issueNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<404, t_basic_error> @@ -15950,8 +17084,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/lock` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForIssue( @@ -15972,7 +17107,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reaction[]> | Res<404, t_basic_error> | Res<410, t_basic_error> @@ -15981,13 +17116,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForIssue( @@ -16008,7 +17148,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reaction> | Res<201, t_reaction> | Res<422, t_validation_error> @@ -16017,14 +17157,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForIssue( @@ -16035,13 +17174,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesListEventsForTimeline( @@ -16053,7 +17193,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_timeline_issue_events[]> @@ -16064,9 +17204,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/issues/${p["issueNumber"]}/timeline` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListDeployKeys( @@ -16077,12 +17222,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateDeployKey( @@ -16096,19 +17246,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetDeployKey( @@ -16118,14 +17267,15 @@ export class ApiClient extends AbstractFetchClient { keyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposDeleteDeployKey( @@ -16135,12 +17285,13 @@ export class ApiClient extends AbstractFetchClient { keyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesListLabelsForRepo( @@ -16151,14 +17302,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesCreateLabel( @@ -16172,21 +17328,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<201, t_label> | Res<404, t_basic_error> | Res<422, t_validation_error> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/labels` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesGetLabel( @@ -16196,12 +17351,13 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async issuesUpdateLabel( @@ -16216,16 +17372,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/labels/${p["name"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -16237,12 +17396,13 @@ export class ApiClient extends AbstractFetchClient { name: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/labels/${p["name"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListLanguages( @@ -16251,11 +17411,12 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/languages` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async licensesGetForRepo( @@ -16265,14 +17426,19 @@ export class ApiClient extends AbstractFetchClient { ref?: t_code_scanning_ref }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/license` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposMergeUpstream( @@ -16284,7 +17450,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_merged_upstream> | Res<409, void> | Res<422, void> @@ -16292,14 +17458,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/merge-upstream` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposMerge( @@ -16313,7 +17478,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_commit> @@ -16325,14 +17490,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/merges` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesListMilestones( @@ -16346,11 +17510,12 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/milestones` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], sort: p["sort"], @@ -16359,7 +17524,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async issuesCreateMilestone( @@ -16374,7 +17543,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_milestone> @@ -16383,14 +17552,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/milestones` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async issuesGetMilestone( @@ -16400,15 +17568,16 @@ export class ApiClient extends AbstractFetchClient { milestoneNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async issuesUpdateMilestone( @@ -16424,17 +17593,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -16446,13 +17618,14 @@ export class ApiClient extends AbstractFetchClient { milestoneNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesListLabelsForMilestone( @@ -16464,14 +17637,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/milestones/${p["milestoneNumber"]}/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListRepoNotificationsForAuthenticatedUser( @@ -16486,10 +17664,11 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/notifications` + const headers = this._headers({}, opts.headers) const query = this._query({ all: p["all"], participating: p["participating"], @@ -16499,7 +17678,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityMarkRepoNotificationsAsRead( @@ -16511,7 +17694,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -16526,14 +17709,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/notifications` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposGetPages( @@ -16542,11 +17724,12 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreatePagesSite( @@ -16562,21 +17745,20 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<201, t_page> | Res<409, t_basic_error> | Res<422, t_validation_error> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposUpdateInformationAboutPagesSite( @@ -16598,7 +17780,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -16608,14 +17790,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeletePagesSite( @@ -16624,7 +17805,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -16634,8 +17815,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListPagesBuilds( @@ -16646,12 +17828,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/builds` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposRequestPagesBuild( @@ -16660,11 +17847,12 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/builds` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async reposGetLatestPagesBuild( @@ -16673,12 +17861,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/builds/latest` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetPagesBuild( @@ -16688,13 +17877,14 @@ export class ApiClient extends AbstractFetchClient { buildId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/builds/${p["buildId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreatePagesDeployment( @@ -16710,7 +17900,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_page_deployment> @@ -16721,14 +17911,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/deployments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetPagesDeployment( @@ -16738,7 +17927,7 @@ export class ApiClient extends AbstractFetchClient { pagesDeploymentId: number | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_pages_deployment_status> | Res<404, t_basic_error> @@ -16747,8 +17936,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/deployments/${p["pagesDeploymentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCancelPagesDeployment( @@ -16758,13 +17948,14 @@ export class ApiClient extends AbstractFetchClient { pagesDeploymentId: number | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/deployments/${p["pagesDeploymentId"]}/cancel` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async reposGetPagesHealthCheck( @@ -16773,7 +17964,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pages_health_check> @@ -16784,8 +17975,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pages/health` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCheckPrivateVulnerabilityReporting( @@ -16794,7 +17986,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -16809,8 +18001,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/private-vulnerability-reporting` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposEnablePrivateVulnerabilityReporting( @@ -16819,13 +18012,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<422, t_scim_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/private-vulnerability-reporting` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async reposDisablePrivateVulnerabilityReporting( @@ -16834,13 +18028,14 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<422, t_scim_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/private-vulnerability-reporting` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async projectsListForRepo( @@ -16852,7 +18047,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_project[]> @@ -16864,13 +18059,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async projectsCreateForRepo( @@ -16883,7 +18083,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_project> @@ -16895,14 +18095,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/projects` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetCustomPropertiesValues( @@ -16911,7 +18110,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_custom_property_value[]> @@ -16921,8 +18120,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/properties/values` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateOrUpdateCustomPropertiesValues( @@ -16934,7 +18134,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -16945,12 +18145,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/properties/values` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -16968,7 +18171,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request_simple[]> @@ -16977,6 +18180,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], head: p["head"], @@ -16987,7 +18191,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsCreate( @@ -17006,7 +18214,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_pull_request> @@ -17015,14 +18223,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsListReviewCommentsForRepo( @@ -17036,10 +18243,11 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -17048,7 +18256,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsGetReviewComment( @@ -17058,7 +18270,7 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_pull_request_review_comment> | Res<404, t_basic_error> @@ -17067,8 +18279,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async pullsUpdateReviewComment( @@ -17081,17 +18294,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -17103,13 +18319,14 @@ export class ApiClient extends AbstractFetchClient { commentId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForPullRequestReviewComment( @@ -17130,20 +18347,25 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForPullRequestReviewComment( @@ -17164,7 +18386,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reaction> | Res<201, t_reaction> | Res<422, t_validation_error> @@ -17173,14 +18395,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForPullRequestComment( @@ -17191,13 +18412,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/comments/${p["commentId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async pullsGet( @@ -17207,7 +18429,7 @@ export class ApiClient extends AbstractFetchClient { pullNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request> @@ -17228,8 +18450,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async pullsUpdate( @@ -17246,7 +18469,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request> @@ -17257,12 +18480,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -17286,7 +18512,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_codespace> @@ -17307,14 +18533,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/codespaces` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsListReviewComments( @@ -17329,11 +18554,12 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -17342,7 +18568,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsCreateReviewComment( @@ -17364,7 +18594,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_pull_request_review_comment> @@ -17375,14 +18605,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsCreateReplyForReviewComment( @@ -17396,7 +18625,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<201, t_pull_request_review_comment> | Res<404, t_basic_error> @@ -17405,14 +18634,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/comments/${p["commentId"]}/replies` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsListCommits( @@ -17424,14 +18652,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsListFiles( @@ -17443,7 +18676,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_diff_entry[]> @@ -17462,9 +18695,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/files` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsCheckIfMerged( @@ -17474,13 +18712,14 @@ export class ApiClient extends AbstractFetchClient { pullNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/merge` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async pullsMerge( @@ -17496,7 +18735,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request_merge_result> @@ -17522,14 +18761,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/merge` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async pullsListRequestedReviewers( @@ -17539,13 +18777,14 @@ export class ApiClient extends AbstractFetchClient { pullNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/requested_reviewers` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async pullsRequestReviewers( @@ -17559,7 +18798,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<201, t_pull_request_simple> | Res<403, t_basic_error> | Res<422, void> @@ -17568,14 +18807,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/requested_reviewers` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsRemoveRequestedReviewers( @@ -17589,7 +18827,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_pull_request_simple> | Res<422, t_validation_error> @@ -17598,12 +18836,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/requested_reviewers` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -17617,14 +18858,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsCreateReview( @@ -17648,7 +18894,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request_review> @@ -17659,14 +18905,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsGetReview( @@ -17677,7 +18922,7 @@ export class ApiClient extends AbstractFetchClient { reviewId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_pull_request_review> | Res<404, t_basic_error> @@ -17686,8 +18931,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async pullsUpdateReview( @@ -17701,7 +18947,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_pull_request_review> | Res<422, t_validation_error_simple> @@ -17710,14 +18956,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async pullsDeletePendingReview( @@ -17728,7 +18973,7 @@ export class ApiClient extends AbstractFetchClient { reviewId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request_review> @@ -17739,8 +18984,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async pullsListCommentsForReview( @@ -17753,16 +18999,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async pullsDismissReview( @@ -17777,7 +19028,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request_review> @@ -17788,14 +19039,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}/dismissals` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async pullsSubmitReview( @@ -17810,7 +19060,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_pull_request_review> @@ -17822,14 +19072,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/reviews/${p["reviewId"]}/events` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pullsUpdateBranch( @@ -17842,7 +19091,7 @@ export class ApiClient extends AbstractFetchClient { } | null }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -17859,14 +19108,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/pulls/${p["pullNumber"]}/update-branch` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposGetReadme( @@ -17876,7 +19124,7 @@ export class ApiClient extends AbstractFetchClient { ref?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_content_file> @@ -17886,9 +19134,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/readme` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetReadmeInDirectory( @@ -17899,7 +19152,7 @@ export class ApiClient extends AbstractFetchClient { ref?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_content_file> @@ -17909,9 +19162,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/readme/${p["dir"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListReleases( @@ -17922,14 +19180,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateRelease( @@ -17949,7 +19212,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_release> @@ -17958,14 +19221,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetReleaseAsset( @@ -17975,7 +19237,7 @@ export class ApiClient extends AbstractFetchClient { assetId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_release_asset> | Res<302, void> | Res<404, t_basic_error> @@ -17984,8 +19246,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/assets/${p["assetId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateReleaseAsset( @@ -18000,17 +19263,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/assets/${p["assetId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -18022,13 +19288,14 @@ export class ApiClient extends AbstractFetchClient { assetId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/assets/${p["assetId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGenerateReleaseNotes( @@ -18043,7 +19310,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_release_notes_content> | Res<404, t_basic_error> @@ -18052,14 +19319,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/generate-notes` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetLatestRelease( @@ -18068,12 +19334,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/latest` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetReleaseByTag( @@ -18083,15 +19350,16 @@ export class ApiClient extends AbstractFetchClient { tag: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/tags/${p["tag"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetRelease( @@ -18101,13 +19369,14 @@ export class ApiClient extends AbstractFetchClient { releaseId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposUpdateRelease( @@ -18127,19 +19396,22 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -18151,13 +19423,14 @@ export class ApiClient extends AbstractFetchClient { releaseId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListReleaseAssets( @@ -18169,14 +19442,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/assets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposUploadReleaseAsset( @@ -18189,20 +19467,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<422, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/assets` - const headers = this._headers({ - "Content-Type": "application/octet-stream", - }) + const headers = this._headers( + { "Content-Type": "application/octet-stream" }, + opts.headers, + ) const query = this._query({ name: p["name"], label: p["label"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "POST", headers, body, ...(opts ?? {}) }, + { method: "POST", body, ...opts, headers }, timeout, ) } @@ -18217,20 +19496,25 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForRelease( @@ -18243,7 +19527,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reaction> | Res<201, t_reaction> | Res<422, t_validation_error> @@ -18252,14 +19536,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsDeleteForRelease( @@ -18270,13 +19553,14 @@ export class ApiClient extends AbstractFetchClient { reactionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/releases/${p["releaseId"]}/reactions/${p["reactionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposGetBranchRules( @@ -18288,14 +19572,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rules/branches/${p["branch"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetRepoRulesets( @@ -18307,7 +19596,7 @@ export class ApiClient extends AbstractFetchClient { includesParents?: boolean }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_ruleset[]> @@ -18316,13 +19605,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], includes_parents: p["includesParents"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateRepoRuleset( @@ -18339,7 +19633,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_repository_ruleset> @@ -18348,14 +19642,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposGetRepoRuleSuites( @@ -18370,7 +19663,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_rule_suites> @@ -18380,6 +19673,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets/rule-suites` + const headers = this._headers({}, opts.headers) const query = this._query({ ref: p["ref"], time_period: p["timePeriod"], @@ -18389,7 +19683,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetRepoRuleSuite( @@ -18399,7 +19697,7 @@ export class ApiClient extends AbstractFetchClient { ruleSuiteId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_rule_suite> | Res<404, t_basic_error> | Res<500, t_basic_error> @@ -18408,8 +19706,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets/rule-suites/${p["ruleSuiteId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetRepoRuleset( @@ -18420,7 +19719,7 @@ export class ApiClient extends AbstractFetchClient { includesParents?: boolean }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_ruleset> @@ -18431,9 +19730,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ includes_parents: p["includesParents"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposUpdateRepoRuleset( @@ -18451,7 +19755,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_ruleset> @@ -18462,14 +19766,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets/${p["rulesetId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposDeleteRepoRuleset( @@ -18479,7 +19782,7 @@ export class ApiClient extends AbstractFetchClient { rulesetId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<500, t_basic_error> @@ -18488,8 +19791,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/rulesets/${p["rulesetId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async secretScanningListAlertsForRepo( @@ -18508,7 +19812,7 @@ export class ApiClient extends AbstractFetchClient { validity?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_secret_scanning_alert[]> @@ -18525,6 +19829,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], secret_type: p["secretType"], @@ -18538,7 +19843,11 @@ export class ApiClient extends AbstractFetchClient { validity: p["validity"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async secretScanningGetAlert( @@ -18548,7 +19857,7 @@ export class ApiClient extends AbstractFetchClient { alertNumber: t_alert_number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_secret_scanning_alert> @@ -18567,8 +19876,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts/${p["alertNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async secretScanningUpdateAlert( @@ -18583,7 +19893,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_secret_scanning_alert> @@ -18603,12 +19913,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts/${p["alertNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -18622,7 +19935,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_secret_scanning_location[]> @@ -18640,9 +19953,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/alerts/${p["alertNumber"]}/locations` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async secretScanningCreatePushProtectionBypass( @@ -18655,7 +19973,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_secret_scanning_push_protection_bypass> @@ -18675,14 +19993,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/secret-scanning/push-protection-bypasses` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async securityAdvisoriesListRepositoryAdvisories( @@ -18697,7 +20014,7 @@ export class ApiClient extends AbstractFetchClient { state?: "triage" | "draft" | "published" | "closed" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_advisory[]> @@ -18707,6 +20024,7 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], sort: p["sort"], @@ -18716,7 +20034,11 @@ export class ApiClient extends AbstractFetchClient { state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async securityAdvisoriesCreateRepositoryAdvisory( @@ -18726,7 +20048,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_repository_advisory_create }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_repository_advisory> @@ -18737,14 +20059,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async securityAdvisoriesCreatePrivateVulnerabilityReport( @@ -18754,7 +20075,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_private_vulnerability_report_create }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_repository_advisory> @@ -18766,14 +20087,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories/reports` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async securityAdvisoriesGetRepositoryAdvisory( @@ -18783,7 +20103,7 @@ export class ApiClient extends AbstractFetchClient { ghsaId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_advisory> @@ -18794,8 +20114,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async securityAdvisoriesUpdateRepositoryAdvisory( @@ -18806,7 +20127,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_repository_advisory_update }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_advisory> @@ -18818,12 +20139,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -18835,7 +20159,7 @@ export class ApiClient extends AbstractFetchClient { ghsaId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18853,8 +20177,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}/cve` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async securityAdvisoriesCreateFork( @@ -18864,7 +20189,7 @@ export class ApiClient extends AbstractFetchClient { ghsaId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<202, t_full_repository> @@ -18877,8 +20202,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/security-advisories/${p["ghsaId"]}/forks` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async activityListStargazersForRepo( @@ -18889,16 +20215,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_simple_user[] | t_stargazer[]> | Res<422, t_validation_error> > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/stargazers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetCodeFrequencyStats( @@ -18907,7 +20238,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_code_frequency_stat[]> @@ -18923,8 +20254,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/stats/code_frequency` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetCommitActivityStats( @@ -18933,7 +20265,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_commit_activity[]> @@ -18948,8 +20280,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/stats/commit_activity` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetContributorsStats( @@ -18958,7 +20291,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_contributor_activity[]> @@ -18973,8 +20306,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/stats/contributors` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetParticipationStats( @@ -18983,7 +20317,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_participation_stats> | Res<404, t_basic_error> @@ -18991,8 +20325,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/stats/participation` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetPunchCardStats( @@ -19001,14 +20336,15 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<204, void>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/stats/punch_card` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateCommitStatus( @@ -19024,18 +20360,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/statuses/${p["sha"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async activityListWatchersForRepo( @@ -19046,12 +20381,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/subscribers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityGetRepoSubscription( @@ -19060,7 +20400,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_subscription> @@ -19069,8 +20409,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/subscription` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activitySetRepoSubscription( @@ -19083,17 +20424,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/subscription` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async activityDeleteRepoSubscription( @@ -19102,11 +20442,12 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/subscription` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposListTags( @@ -19117,12 +20458,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/tags` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListTagProtection( @@ -19131,7 +20477,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_tag_protection[]> @@ -19141,8 +20487,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/tags/protection` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateTagProtection( @@ -19154,7 +20501,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_tag_protection> @@ -19164,14 +20511,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/tags/protection` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposDeleteTagProtection( @@ -19181,7 +20527,7 @@ export class ApiClient extends AbstractFetchClient { tagProtectionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<404, t_basic_error> @@ -19190,8 +20536,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/tags/protection/${p["tagProtectionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposDownloadTarballArchive( @@ -19201,12 +20548,13 @@ export class ApiClient extends AbstractFetchClient { ref: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/tarball/${p["ref"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposListTeams( @@ -19217,12 +20565,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetAllTopics( @@ -19233,12 +20586,17 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/topics` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposReplaceAllTopics( @@ -19250,7 +20608,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_topic> @@ -19259,14 +20617,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/topics` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async reposGetClones( @@ -19276,15 +20633,20 @@ export class ApiClient extends AbstractFetchClient { per?: "day" | "week" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<403, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/traffic/clones` + const headers = this._headers({}, opts.headers) const query = this._query({ per: p["per"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposGetTopPaths( @@ -19293,14 +20655,15 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<403, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/traffic/popular/paths` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetTopReferrers( @@ -19309,15 +20672,16 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<403, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/traffic/popular/referrers` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposGetViews( @@ -19327,15 +20691,20 @@ export class ApiClient extends AbstractFetchClient { per?: "day" | "week" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<403, t_basic_error>> > { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/traffic/views` + const headers = this._headers({}, opts.headers) const query = this._query({ per: p["per"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposTransfer( @@ -19349,17 +20718,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/transfer` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposCheckVulnerabilityAlerts( @@ -19368,12 +20736,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/vulnerability-alerts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposEnableVulnerabilityAlerts( @@ -19382,12 +20751,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/vulnerability-alerts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async reposDisableVulnerabilityAlerts( @@ -19396,12 +20766,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/vulnerability-alerts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reposDownloadZipballArchive( @@ -19411,12 +20782,13 @@ export class ApiClient extends AbstractFetchClient { ref: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["owner"]}/${p["repo"]}/zipball/${p["ref"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async reposCreateUsingTemplate( @@ -19432,19 +20804,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/repos/${p["templateOwner"]}/${p["templateRepo"]}/generate` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposListPublic( @@ -19452,7 +20823,7 @@ export class ApiClient extends AbstractFetchClient { since?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_minimal_repository[]> @@ -19461,9 +20832,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchCode( @@ -19475,7 +20851,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19500,6 +20876,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/code` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19508,7 +20885,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchCommits( @@ -19520,7 +20901,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19535,6 +20916,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/commits` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19543,7 +20925,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchIssuesAndPullRequests( @@ -19566,7 +20952,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19591,6 +20977,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19599,7 +20986,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchLabels( @@ -19612,7 +21003,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19630,6 +21021,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/labels` + const headers = this._headers({}, opts.headers) const query = this._query({ repository_id: p["repositoryId"], q: p["q"], @@ -19639,7 +21031,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchRepos( @@ -19651,7 +21047,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19675,6 +21071,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19683,7 +21080,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchTopics( @@ -19693,7 +21094,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19708,13 +21109,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/topics` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async searchUsers( @@ -19726,7 +21132,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19750,6 +21156,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/search/users` + const headers = this._headers({}, opts.headers) const query = this._query({ q: p["q"], sort: p["sort"], @@ -19758,7 +21165,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsGetLegacy( @@ -19766,13 +21177,14 @@ export class ApiClient extends AbstractFetchClient { teamId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/teams/${p["teamId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsUpdateLegacy( @@ -19790,7 +21202,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_team_full> @@ -19801,12 +21213,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/teams/${p["teamId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -19816,15 +21231,16 @@ export class ApiClient extends AbstractFetchClient { teamId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<422, t_validation_error> > > { const url = this.basePath + `/teams/${p["teamId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListDiscussionsLegacy( @@ -19835,16 +21251,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCreateDiscussionLegacy( @@ -19857,17 +21278,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async teamsGetDiscussionLegacy( @@ -19876,13 +21296,14 @@ export class ApiClient extends AbstractFetchClient { discussionNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsUpdateDiscussionLegacy( @@ -19895,17 +21316,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -19916,13 +21340,14 @@ export class ApiClient extends AbstractFetchClient { discussionNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListDiscussionCommentsLegacy( @@ -19934,18 +21359,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments` + const headers = this._headers({}, opts.headers) const query = this._query({ direction: p["direction"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCreateDiscussionCommentLegacy( @@ -19957,19 +21387,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async teamsGetDiscussionCommentLegacy( @@ -19979,13 +21408,14 @@ export class ApiClient extends AbstractFetchClient { commentNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsUpdateDiscussionCommentLegacy( @@ -19998,17 +21428,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -20020,13 +21453,14 @@ export class ApiClient extends AbstractFetchClient { commentNumber: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async reactionsListForTeamDiscussionCommentLegacy( @@ -20047,18 +21481,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForTeamDiscussionCommentLegacy( @@ -20079,19 +21518,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/comments/${p["commentNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reactionsListForTeamDiscussionLegacy( @@ -20111,18 +21549,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/reactions` + const headers = this._headers({}, opts.headers) const query = this._query({ content: p["content"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reactionsCreateForTeamDiscussionLegacy( @@ -20142,19 +21585,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/discussions/${p["discussionNumber"]}/reactions` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async teamsListPendingInvitationsLegacy( @@ -20164,12 +21606,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsListMembersLegacy( @@ -20180,18 +21627,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/teams/${p["teamId"]}/members` + const headers = this._headers({}, opts.headers) const query = this._query({ role: p["role"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsGetMemberLegacy( @@ -20200,11 +21652,12 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/teams/${p["teamId"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddMemberLegacy( @@ -20213,15 +21666,16 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<404, void> | Res<422, void> > > { const url = this.basePath + `/teams/${p["teamId"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async teamsRemoveMemberLegacy( @@ -20230,11 +21684,12 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/teams/${p["teamId"]}/members/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsGetMembershipForUserLegacy( @@ -20243,14 +21698,15 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/teams/${p["teamId"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddOrUpdateMembershipForUserLegacy( @@ -20262,7 +21718,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_team_membership> @@ -20273,14 +21729,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/teams/${p["teamId"]}/memberships/${p["username"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async teamsRemoveMembershipForUserLegacy( @@ -20289,12 +21744,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<403, void>>> { const url = this.basePath + `/teams/${p["teamId"]}/memberships/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListProjectsLegacy( @@ -20304,14 +21760,19 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<404, t_basic_error>> > { const url = this.basePath + `/teams/${p["teamId"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCheckPermissionsForProjectLegacy( @@ -20320,12 +21781,13 @@ export class ApiClient extends AbstractFetchClient { projectId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/teams/${p["teamId"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddOrUpdateProjectPermissionsLegacy( @@ -20337,7 +21799,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20354,14 +21816,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/teams/${p["teamId"]}/projects/${p["projectId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async teamsRemoveProjectLegacy( @@ -20370,7 +21831,7 @@ export class ApiClient extends AbstractFetchClient { projectId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<404, t_basic_error> | Res<422, t_validation_error> @@ -20378,8 +21839,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/teams/${p["teamId"]}/projects/${p["projectId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListReposLegacy( @@ -20389,16 +21851,21 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_minimal_repository[]> | Res<404, t_basic_error> > > { const url = this.basePath + `/teams/${p["teamId"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsCheckPermissionsForRepoLegacy( @@ -20408,7 +21875,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_team_repository> | Res<204, void> | Res<404, void> @@ -20416,8 +21883,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/teams/${p["teamId"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async teamsAddOrUpdateRepoPermissionsLegacy( @@ -20430,7 +21898,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_basic_error> | Res<422, t_validation_error> @@ -20438,14 +21906,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/teams/${p["teamId"]}/repos/${p["owner"]}/${p["repo"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async teamsRemoveRepoLegacy( @@ -20455,12 +21922,13 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/teams/${p["teamId"]}/repos/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async teamsListChildLegacy( @@ -20470,7 +21938,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_team[]> @@ -20480,14 +21948,19 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/teams/${p["teamId"]}/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersGetAuthenticated( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_private_user | t_public_user> @@ -20497,8 +21970,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersUpdateAuthenticated( @@ -20515,7 +21989,7 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_private_user> @@ -20527,12 +22001,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -20543,7 +22020,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_simple_user[]> @@ -20554,9 +22031,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/blocks` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersCheckBlocked( @@ -20564,7 +22046,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20575,8 +22057,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersBlock( @@ -20584,7 +22067,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20596,8 +22079,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async usersUnblock( @@ -20605,7 +22089,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20616,8 +22100,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/blocks/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesListForAuthenticatedUser( @@ -20627,7 +22112,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -20645,13 +22130,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"], repository_id: p["repositoryId"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesCreateForAuthenticatedUser( @@ -20685,7 +22175,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_codespace> @@ -20703,15 +22193,14 @@ export class ApiClient extends AbstractFetchClient { > > > { - const url = this.basePath + `/user/codespaces` - const headers = this._headers({ "Content-Type": "application/json" }) - const body = JSON.stringify(p.requestBody) - - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, + const url = this.basePath + `/user/codespaces` + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, ) + const body = JSON.stringify(p.requestBody) + + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codespacesListSecretsForAuthenticatedUser( @@ -20720,7 +22209,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res< @@ -20733,18 +22222,24 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/secrets` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async codespacesGetPublicKeyForAuthenticatedUser( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/codespaces/secrets/public-key` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesGetSecretForAuthenticatedUser( @@ -20752,11 +22247,12 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesCreateOrUpdateSecretForAuthenticatedUser( @@ -20769,7 +22265,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_empty_object> @@ -20779,14 +22275,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codespacesDeleteSecretForAuthenticatedUser( @@ -20794,11 +22289,12 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesListRepositoriesForSecretForAuthenticatedUser( @@ -20806,7 +22302,7 @@ export class ApiClient extends AbstractFetchClient { secretName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -20824,8 +22320,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}/repositories` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesSetRepositoriesForSecretForAuthenticatedUser( @@ -20836,7 +22333,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20848,14 +22345,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}/repositories` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async codespacesAddRepositoryForSecretForAuthenticatedUser( @@ -20864,7 +22360,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20877,8 +22373,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async codespacesRemoveRepositoryForSecretForAuthenticatedUser( @@ -20887,7 +22384,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -20900,8 +22397,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/codespaces/secrets/${p["secretName"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesGetForAuthenticatedUser( @@ -20909,7 +22407,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_codespace> @@ -20921,8 +22419,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesUpdateForAuthenticatedUser( @@ -20935,7 +22434,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_codespace> @@ -20945,12 +22444,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -20960,7 +22462,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -20977,8 +22479,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async codespacesExportForAuthenticatedUser( @@ -20986,7 +22489,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<202, t_codespace_export_details> @@ -20998,8 +22501,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}/exports` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async codespacesGetExportDetailsForAuthenticatedUser( @@ -21008,7 +22512,7 @@ export class ApiClient extends AbstractFetchClient { exportId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_codespace_export_details> | Res<404, t_basic_error> @@ -21017,8 +22521,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}/exports/${p["exportId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesCodespaceMachinesForAuthenticatedUser( @@ -21026,7 +22531,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -21045,8 +22550,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}/machines` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async codespacesPublishForAuthenticatedUser( @@ -21058,7 +22564,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_codespace_with_full_repository> @@ -21069,14 +22575,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}/publish` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async codespacesStartForAuthenticatedUser( @@ -21084,7 +22589,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_codespace> @@ -21099,8 +22604,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}/start` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async codespacesStopForAuthenticatedUser( @@ -21108,7 +22614,7 @@ export class ApiClient extends AbstractFetchClient { codespaceName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_codespace> @@ -21119,17 +22625,19 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/codespaces/${p["codespaceName"]}/stop` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async packagesListDockerMigrationConflictingPackagesForAuthenticatedUser( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/docker/conflicts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersSetPrimaryEmailVisibilityForAuthenticatedUser( @@ -21139,7 +22647,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_email[]> @@ -21151,12 +22659,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/email/visibility` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -21167,7 +22678,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_email[]> @@ -21178,9 +22689,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/emails` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersAddEmailForAuthenticatedUser( @@ -21193,7 +22709,7 @@ export class ApiClient extends AbstractFetchClient { | string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_email[]> @@ -21205,14 +22721,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/emails` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async usersDeleteEmailForAuthenticatedUser( @@ -21225,7 +22740,7 @@ export class ApiClient extends AbstractFetchClient { | string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21237,12 +22752,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/emails` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -21253,7 +22771,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_simple_user[]> @@ -21263,9 +22781,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/followers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersListFollowedByAuthenticatedUser( @@ -21274,7 +22797,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_simple_user[]> @@ -21284,9 +22807,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/following` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersCheckPersonIsFollowedByAuthenticated( @@ -21294,7 +22822,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21305,8 +22833,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/following/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersFollow( @@ -21314,7 +22843,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21325,8 +22854,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/following/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async usersUnfollow( @@ -21334,7 +22864,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21345,8 +22875,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/following/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async usersListGpgKeysForAuthenticatedUser( @@ -21355,7 +22886,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gpg_key[]> @@ -21366,9 +22897,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/gpg_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersCreateGpgKeyForAuthenticatedUser( @@ -21379,7 +22915,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_gpg_key> @@ -21391,14 +22927,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/gpg_keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async usersGetGpgKeyForAuthenticatedUser( @@ -21406,7 +22941,7 @@ export class ApiClient extends AbstractFetchClient { gpgKeyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_gpg_key> @@ -21417,8 +22952,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/gpg_keys/${p["gpgKeyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersDeleteGpgKeyForAuthenticatedUser( @@ -21426,7 +22962,7 @@ export class ApiClient extends AbstractFetchClient { gpgKeyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21438,8 +22974,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/gpg_keys/${p["gpgKeyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async appsListInstallationsForAuthenticatedUser( @@ -21448,7 +22985,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -21464,9 +23001,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/installations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsListInstallationReposForAuthenticatedUser( @@ -21476,7 +23018,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -21494,9 +23036,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/installations/${p["installationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsAddRepoToInstallationForAuthenticatedUser( @@ -21505,7 +23052,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21517,8 +23064,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/installations/${p["installationId"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async appsRemoveRepoFromInstallationForAuthenticatedUser( @@ -21527,7 +23075,7 @@ export class ApiClient extends AbstractFetchClient { repositoryId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21540,21 +23088,23 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/installations/${p["installationId"]}/repositories/${p["repositoryId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async interactionsGetRestrictionsForAuthenticatedUser( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_interaction_limit_response | EmptyObject> | Res<204, void> > > { const url = this.basePath + `/user/interaction-limits` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async interactionsSetRestrictionsForAuthenticatedUser( @@ -21562,30 +23112,30 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_interaction_limit }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_interaction_limit_response> | Res<422, t_validation_error> > > { const url = this.basePath + `/user/interaction-limits` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async interactionsRemoveRestrictionsForAuthenticatedUser( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/interaction-limits` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async issuesListForAuthenticatedUser( @@ -21606,13 +23156,14 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issue[]> | Res<304, void> | Res<404, t_basic_error> > > { const url = this.basePath + `/user/issues` + const headers = this._headers({}, opts.headers) const query = this._query({ filter: p["filter"], state: p["state"], @@ -21624,7 +23175,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersListPublicSshKeysForAuthenticatedUser( @@ -21633,7 +23188,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_key[]> @@ -21644,9 +23199,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersCreatePublicSshKeyForAuthenticatedUser( @@ -21657,7 +23217,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_key> @@ -21669,14 +23229,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async usersGetPublicSshKeyForAuthenticatedUser( @@ -21684,7 +23243,7 @@ export class ApiClient extends AbstractFetchClient { keyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_key> @@ -21695,8 +23254,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersDeletePublicSshKeyForAuthenticatedUser( @@ -21704,7 +23264,7 @@ export class ApiClient extends AbstractFetchClient { keyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21715,8 +23275,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/keys/${p["keyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async appsListSubscriptionsForAuthenticatedUser( @@ -21725,7 +23286,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_user_marketplace_purchase[]> @@ -21735,9 +23296,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/marketplace_purchases` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsListSubscriptionsForAuthenticatedUserStubbed( @@ -21746,7 +23312,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_user_marketplace_purchase[]> @@ -21755,9 +23321,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/marketplace_purchases/stubbed` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListMembershipsForAuthenticatedUser( @@ -21767,7 +23338,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_membership[]> @@ -21778,13 +23349,18 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/memberships/orgs` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsGetMembershipForAuthenticatedUser( @@ -21792,7 +23368,7 @@ export class ApiClient extends AbstractFetchClient { org: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_membership> @@ -21801,8 +23377,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/memberships/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async orgsUpdateMembershipForAuthenticatedUser( @@ -21813,7 +23390,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_org_membership> @@ -21823,12 +23400,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/memberships/orgs/${p["org"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -21839,7 +23419,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_migration[]> @@ -21849,9 +23429,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/migrations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async migrationsStartForAuthenticatedUser( @@ -21869,7 +23454,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_migration> @@ -21880,14 +23465,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/migrations` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async migrationsGetStatusForAuthenticatedUser( @@ -21896,7 +23480,7 @@ export class ApiClient extends AbstractFetchClient { exclude?: string[] }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_migration> @@ -21907,9 +23491,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/migrations/${p["migrationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ exclude: p["exclude"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async migrationsGetArchiveForAuthenticatedUser( @@ -21917,7 +23506,7 @@ export class ApiClient extends AbstractFetchClient { migrationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<302, void> @@ -21927,8 +23516,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async migrationsDeleteArchiveForAuthenticatedUser( @@ -21936,7 +23526,7 @@ export class ApiClient extends AbstractFetchClient { migrationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21947,8 +23537,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/migrations/${p["migrationId"]}/archive` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async migrationsUnlockRepoForAuthenticatedUser( @@ -21957,7 +23548,7 @@ export class ApiClient extends AbstractFetchClient { repoName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -21970,8 +23561,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/migrations/${p["migrationId"]}/repos/${p["repoName"]}/lock` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async migrationsListReposForAuthenticatedUser( @@ -21981,7 +23573,7 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_minimal_repository[]> | Res<404, t_basic_error> @@ -21989,9 +23581,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/migrations/${p["migrationId"]}/repositories` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListForAuthenticatedUser( @@ -22000,7 +23597,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_organization_simple[]> @@ -22010,9 +23607,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/orgs` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesListPackagesForAuthenticatedUser( @@ -22029,9 +23631,10 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<400, void>>> { const url = this.basePath + `/user/packages` + const headers = this._headers({}, opts.headers) const query = this._query({ package_type: p["packageType"], visibility: p["visibility"], @@ -22039,7 +23642,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesGetPackageForAuthenticatedUser( @@ -22054,12 +23661,13 @@ export class ApiClient extends AbstractFetchClient { packageName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesDeletePackageForAuthenticatedUser( @@ -22074,7 +23682,7 @@ export class ApiClient extends AbstractFetchClient { packageName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22085,8 +23693,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesRestorePackageForAuthenticatedUser( @@ -22102,7 +23711,7 @@ export class ApiClient extends AbstractFetchClient { token?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22114,11 +23723,12 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}/restore` + const headers = this._headers({}, opts.headers) const query = this._query({ token: p["token"] }) return this._fetch( url + query, - { method: "POST", ...(opts ?? {}) }, + { method: "POST", ...opts, headers }, timeout, ) } @@ -22138,7 +23748,7 @@ export class ApiClient extends AbstractFetchClient { state?: "active" | "deleted" }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_package_version[]> @@ -22150,13 +23760,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}/versions` + const headers = this._headers({}, opts.headers) const query = this._query({ page: p["page"], per_page: p["perPage"], state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesGetPackageVersionForAuthenticatedUser( @@ -22172,13 +23787,14 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesDeletePackageVersionForAuthenticatedUser( @@ -22194,7 +23810,7 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22206,8 +23822,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesRestorePackageVersionForAuthenticatedUser( @@ -22223,7 +23840,7 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22235,8 +23852,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/user/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}/restore` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async projectsCreateForAuthenticatedUser( @@ -22247,7 +23865,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_project> @@ -22258,14 +23876,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/projects` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async usersListPublicEmailsForAuthenticatedUser( @@ -22274,7 +23891,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_email[]> @@ -22285,9 +23902,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/public_emails` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListForAuthenticatedUser( @@ -22303,7 +23925,7 @@ export class ApiClient extends AbstractFetchClient { before?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository[]> @@ -22314,6 +23936,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ visibility: p["visibility"], affiliation: p["affiliation"], @@ -22326,7 +23949,11 @@ export class ApiClient extends AbstractFetchClient { before: p["before"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposCreateForAuthenticatedUser( @@ -22358,7 +23985,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_full_repository> @@ -22371,14 +23998,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/repos` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async reposListInvitationsForAuthenticatedUser( @@ -22387,7 +24013,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_repository_invitation[]> @@ -22398,9 +24024,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/repository_invitations` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposAcceptInvitationForAuthenticatedUser( @@ -22408,7 +24039,7 @@ export class ApiClient extends AbstractFetchClient { invitationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22420,8 +24051,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/repository_invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PATCH", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PATCH", ...opts, headers }, timeout) } async reposDeclineInvitationForAuthenticatedUser( @@ -22429,7 +24061,7 @@ export class ApiClient extends AbstractFetchClient { invitationId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22441,8 +24073,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/user/repository_invitations/${p["invitationId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async usersListSocialAccountsForAuthenticatedUser( @@ -22451,7 +24084,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_social_account[]> @@ -22462,9 +24095,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/social_accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersAddSocialAccountForAuthenticatedUser( @@ -22474,7 +24112,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_social_account[]> @@ -22486,14 +24124,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/social_accounts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async usersDeleteSocialAccountForAuthenticatedUser( @@ -22503,7 +24140,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22515,12 +24152,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/social_accounts` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -22531,7 +24171,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_ssh_signing_key[]> @@ -22542,9 +24182,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/ssh_signing_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersCreateSshSigningKeyForAuthenticatedUser( @@ -22555,7 +24200,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_ssh_signing_key> @@ -22567,14 +24212,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/ssh_signing_keys` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async usersGetSshSigningKeyForAuthenticatedUser( @@ -22582,7 +24226,7 @@ export class ApiClient extends AbstractFetchClient { sshSigningKeyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_ssh_signing_key> @@ -22593,8 +24237,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/ssh_signing_keys/${p["sshSigningKeyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersDeleteSshSigningKeyForAuthenticatedUser( @@ -22602,7 +24247,7 @@ export class ApiClient extends AbstractFetchClient { sshSigningKeyId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22613,8 +24258,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/ssh_signing_keys/${p["sshSigningKeyId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async activityListReposStarredByAuthenticatedUser( @@ -22625,7 +24271,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_starred_repository[]> @@ -22635,6 +24281,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/starred` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -22642,7 +24289,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityCheckRepoIsStarredByAuthenticatedUser( @@ -22651,7 +24302,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22662,8 +24313,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/starred/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activityStarRepoForAuthenticatedUser( @@ -22672,7 +24324,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22683,8 +24335,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/starred/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "PUT", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "PUT", ...opts, headers }, timeout) } async activityUnstarRepoForAuthenticatedUser( @@ -22693,7 +24346,7 @@ export class ApiClient extends AbstractFetchClient { repo: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -22704,8 +24357,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/starred/${p["owner"]}/${p["repo"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async activityListWatchedReposForAuthenticatedUser( @@ -22714,7 +24368,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_minimal_repository[]> @@ -22724,9 +24378,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/subscriptions` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async teamsListForAuthenticatedUser( @@ -22735,7 +24394,7 @@ export class ApiClient extends AbstractFetchClient { page?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_team_full[]> @@ -22745,9 +24404,14 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/user/teams` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersGetById( @@ -22755,15 +24419,16 @@ export class ApiClient extends AbstractFetchClient { accountId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_private_user | t_public_user> | Res<404, t_basic_error> > > { const url = this.basePath + `/user/${p["accountId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersList( @@ -22772,12 +24437,17 @@ export class ApiClient extends AbstractFetchClient { perPage?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<304, void>>> { const url = this.basePath + `/users` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersGetByUsername( @@ -22785,15 +24455,16 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_private_user | t_public_user> | Res<404, t_basic_error> > > { const url = this.basePath + `/users/${p["username"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersListAttestations( @@ -22805,7 +24476,7 @@ export class ApiClient extends AbstractFetchClient { subjectDigest: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -22825,13 +24496,18 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/users/${p["username"]}/attestations/${p["subjectDigest"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], before: p["before"], after: p["after"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesListDockerMigrationConflictingPackagesForUser( @@ -22839,15 +24515,16 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_package[]> | Res<401, t_basic_error> | Res<403, t_basic_error> > > { const url = this.basePath + `/users/${p["username"]}/docker/conflicts` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async activityListEventsForAuthenticatedUser( @@ -22857,12 +24534,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListOrgEventsForAuthenticatedUser( @@ -22873,13 +24555,18 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/events/orgs/${p["org"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListPublicEventsForUser( @@ -22889,12 +24576,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/events/public` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersListFollowersForUser( @@ -22904,12 +24596,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/followers` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersListFollowingForUser( @@ -22919,12 +24616,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/following` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersCheckFollowingForUser( @@ -22933,12 +24635,13 @@ export class ApiClient extends AbstractFetchClient { targetUser: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, void>>> { const url = this.basePath + `/users/${p["username"]}/following/${p["targetUser"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async gistsListForUser( @@ -22949,18 +24652,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/users/${p["username"]}/gists` + const headers = this._headers({}, opts.headers) const query = this._query({ since: p["since"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersListGpgKeysForUser( @@ -22970,12 +24678,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/gpg_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersGetContextForUser( @@ -22985,7 +24698,7 @@ export class ApiClient extends AbstractFetchClient { subjectId?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_hovercard> @@ -22994,12 +24707,17 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/users/${p["username"]}/hovercard` + const headers = this._headers({}, opts.headers) const query = this._query({ subject_type: p["subjectType"], subject_id: p["subjectId"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async appsGetUserInstallation( @@ -23007,11 +24725,12 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/installation` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersListPublicKeysForUser( @@ -23021,12 +24740,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async orgsListForUser( @@ -23036,12 +24760,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/orgs` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesListPackagesForUser( @@ -23059,7 +24788,7 @@ export class ApiClient extends AbstractFetchClient { perPage?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_package[]> @@ -23069,6 +24798,7 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/users/${p["username"]}/packages` + const headers = this._headers({}, opts.headers) const query = this._query({ package_type: p["packageType"], visibility: p["visibility"], @@ -23076,7 +24806,11 @@ export class ApiClient extends AbstractFetchClient { per_page: p["perPage"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async packagesGetPackageForUser( @@ -23092,13 +24826,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesDeletePackageForUser( @@ -23114,7 +24849,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -23126,8 +24861,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesRestorePackageForUser( @@ -23144,7 +24880,7 @@ export class ApiClient extends AbstractFetchClient { token?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -23156,11 +24892,12 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/restore` + const headers = this._headers({}, opts.headers) const query = this._query({ token: p["token"] }) return this._fetch( url + query, - { method: "POST", ...(opts ?? {}) }, + { method: "POST", ...opts, headers }, timeout, ) } @@ -23178,7 +24915,7 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_package_version[]> @@ -23190,8 +24927,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesGetPackageVersionForUser( @@ -23208,13 +24946,14 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async packagesDeletePackageVersionForUser( @@ -23231,7 +24970,7 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -23243,8 +24982,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async packagesRestorePackageVersionForUser( @@ -23261,7 +25001,7 @@ export class ApiClient extends AbstractFetchClient { packageVersionId: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -23273,8 +25013,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/users/${p["username"]}/packages/${p["packageType"]}/${p["packageName"]}/versions/${p["packageVersionId"]}/restore` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async projectsListForUser( @@ -23285,18 +25026,23 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<422, t_validation_error>> > { const url = this.basePath + `/users/${p["username"]}/projects` + const headers = this._headers({}, opts.headers) const query = this._query({ state: p["state"], per_page: p["perPage"], page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListReceivedEventsForUser( @@ -23306,12 +25052,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/received_events` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListReceivedPublicEventsForUser( @@ -23321,12 +25072,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/received_events/public` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async reposListForUser( @@ -23339,9 +25095,10 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/repos` + const headers = this._headers({}, opts.headers) const query = this._query({ type: p["type"], sort: p["sort"], @@ -23350,7 +25107,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async billingGetGithubActionsBillingUser( @@ -23358,12 +25119,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/settings/billing/actions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async billingGetGithubPackagesBillingUser( @@ -23371,12 +25133,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/settings/billing/packages` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async billingGetSharedStorageBillingUser( @@ -23384,12 +25147,13 @@ export class ApiClient extends AbstractFetchClient { username: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/settings/billing/shared-storage` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async usersListSocialAccountsForUser( @@ -23399,12 +25163,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/social_accounts` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async usersListSshSigningKeysForUser( @@ -23414,12 +25183,17 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/ssh_signing_keys` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListReposStarredByUser( @@ -23431,11 +25205,12 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse> > { const url = this.basePath + `/users/${p["username"]}/starred` + const headers = this._headers({}, opts.headers) const query = this._query({ sort: p["sort"], direction: p["direction"], @@ -23443,7 +25218,11 @@ export class ApiClient extends AbstractFetchClient { page: p["page"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async activityListReposWatchedByUser( @@ -23453,29 +25232,36 @@ export class ApiClient extends AbstractFetchClient { page?: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/users/${p["username"]}/subscriptions` + const headers = this._headers({}, opts.headers) const query = this._query({ per_page: p["perPage"], page: p["page"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async metaGetAllVersions( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<404, t_basic_error>>> { const url = this.basePath + `/versions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async metaGetZen( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/zen` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } } diff --git a/integration-tests/typescript-fetch/src/generated/azure-core-data-plane-service.tsp/client.ts b/integration-tests/typescript-fetch/src/generated/azure-core-data-plane-service.tsp/client.ts index 9a2a4612..e28db84f 100644 --- a/integration-tests/typescript-fetch/src/generated/azure-core-data-plane-service.tsp/client.ts +++ b/integration-tests/typescript-fetch/src/generated/azure-core-data-plane-service.tsp/client.ts @@ -41,7 +41,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -54,14 +54,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/service-status` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -73,7 +74,7 @@ export class ApiClient extends AbstractFetchClient { operationId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -96,9 +97,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/widgets/${p["widgetName"]}/operations/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async widgetsCreateOrUpdateWidget( @@ -115,7 +121,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_WidgetCreateOrUpdate }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Widget> @@ -124,22 +130,25 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}` - const headers = this._headers({ - "Content-Type": "application/merge-patch+json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/merge-patch+json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -155,7 +164,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Widget> @@ -163,18 +172,21 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -192,7 +204,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -207,20 +219,23 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}` - const headers = this._headers({ - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "DELETE", headers, ...(opts ?? {}) }, + { method: "DELETE", ...opts, headers }, timeout, ) } @@ -235,7 +250,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_PagedWidget> @@ -243,9 +258,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"], top: p["top"], @@ -256,7 +272,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -272,7 +288,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_WidgetAnalytics> @@ -280,18 +296,21 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}/analytics/current` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -310,7 +329,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_WidgetAnalyticsCreateOrUpdate }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_WidgetAnalytics> @@ -319,22 +338,25 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}/analytics/current` - const headers = this._headers({ - "Content-Type": "application/merge-patch+json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/merge-patch+json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -346,7 +368,7 @@ export class ApiClient extends AbstractFetchClient { operationId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -363,9 +385,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/widgets/${p["widgetId"]}/repairs/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async widgetsScheduleRepairs( @@ -378,7 +405,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_WidgetRepairRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -400,18 +427,21 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}:scheduleRepairs` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "POST", headers, body, ...(opts ?? {}) }, + { method: "POST", body, ...opts, headers }, timeout, ) } @@ -424,7 +454,7 @@ export class ApiClient extends AbstractFetchClient { operationId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -442,9 +472,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/widgets/${p["widgetName"]}/parts/${p["widgetPartName"]}/operations/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async widgetPartsCreateWidgetPart( @@ -461,29 +496,32 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_WidgetPart }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<201, void> | Res > > { const url = this.basePath + `/widgets/${p["widgetName"]}/parts` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "POST", headers, body, ...(opts ?? {}) }, + { method: "POST", body, ...opts, headers }, timeout, ) } @@ -495,7 +533,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_PagedWidgetPart> @@ -503,14 +541,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}/parts` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -527,7 +566,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_WidgetPart> @@ -536,18 +575,21 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/widgets/${p["widgetName"]}/parts/${p["widgetPartName"]}` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -566,7 +608,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res @@ -574,20 +616,23 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/widgets/${p["widgetName"]}/parts/${p["widgetPartName"]}` - const headers = this._headers({ - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "DELETE", headers, ...(opts ?? {}) }, + { method: "DELETE", ...opts, headers }, timeout, ) } @@ -602,7 +647,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_WidgetPartReorderRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -617,18 +662,21 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/widgets/${p["widgetName"]}/parts:reorderParts` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "POST", headers, body, ...(opts ?? {}) }, + { method: "POST", body, ...opts, headers }, timeout, ) } @@ -640,7 +688,7 @@ export class ApiClient extends AbstractFetchClient { operationId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -658,9 +706,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/manufacturers/${p["manufacturerId"]}/operations/${p["operationId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async manufacturersCreateManufacturer( @@ -677,7 +730,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_Manufacturer }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Manufacturer> @@ -686,22 +739,25 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/manufacturers/${p["manufacturerId"]}` - const headers = this._headers({ - "Content-Type": "application/json", - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Content-Type": "application/json", + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "PUT", headers, body, ...(opts ?? {}) }, + { method: "PUT", body, ...opts, headers }, timeout, ) } @@ -717,7 +773,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Manufacturer> @@ -725,18 +781,21 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/manufacturers/${p["manufacturerId"]}` - const headers = this._headers({ - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } @@ -754,7 +813,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -769,20 +828,23 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/manufacturers/${p["manufacturerId"]}` - const headers = this._headers({ - "Repeatability-Request-ID": p["repeatabilityRequestId"], - "Repeatability-First-Sent": p["repeatabilityFirstSent"], - "If-Match": p["ifMatch"], - "If-None-Match": p["ifNoneMatch"], - "If-Unmodified-Since": p["ifUnmodifiedSince"], - "If-Modified-Since": p["ifModifiedSince"], - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { + "Repeatability-Request-ID": p["repeatabilityRequestId"], + "Repeatability-First-Sent": p["repeatabilityFirstSent"], + "If-Match": p["ifMatch"], + "If-None-Match": p["ifNoneMatch"], + "If-Unmodified-Since": p["ifUnmodifiedSince"], + "If-Modified-Since": p["ifModifiedSince"], + "x-ms-client-request-id": p["xMsClientRequestId"], + }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "DELETE", headers, ...(opts ?? {}) }, + { method: "DELETE", ...opts, headers }, timeout, ) } @@ -793,7 +855,7 @@ export class ApiClient extends AbstractFetchClient { xMsClientRequestId?: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_PagedManufacturer> @@ -801,14 +863,15 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/manufacturers` - const headers = this._headers({ - "x-ms-client-request-id": p["xMsClientRequestId"], - }) + const headers = this._headers( + { "x-ms-client-request-id": p["xMsClientRequestId"] }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "GET", headers, ...(opts ?? {}) }, + { method: "GET", ...opts, headers }, timeout, ) } diff --git a/integration-tests/typescript-fetch/src/generated/azure-resource-manager.tsp/client.ts b/integration-tests/typescript-fetch/src/generated/azure-resource-manager.tsp/client.ts index e5fe2a84..71d01eb9 100644 --- a/integration-tests/typescript-fetch/src/generated/azure-resource-manager.tsp/client.ts +++ b/integration-tests/typescript-fetch/src/generated/azure-resource-manager.tsp/client.ts @@ -32,7 +32,7 @@ export class ApiClient extends AbstractFetchClient { apiVersion: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_OperationListResult> @@ -41,9 +41,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/providers/Microsoft.ContosoProviderHub/operations` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async employeesGet( @@ -54,7 +59,7 @@ export class ApiClient extends AbstractFetchClient { employeeName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Employee> @@ -64,9 +69,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async employeesCreateOrUpdate( @@ -78,7 +88,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_Employee }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Employee> @@ -89,13 +99,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "PUT", headers, body, ...(opts ?? {}) }, + { method: "PUT", body, ...opts, headers }, timeout, ) } @@ -109,7 +122,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_EmployeeUpdate }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Employee> @@ -119,13 +132,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -138,7 +154,7 @@ export class ApiClient extends AbstractFetchClient { employeeName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<202, void> @@ -149,11 +165,12 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) return this._fetch( url + query, - { method: "DELETE", ...(opts ?? {}) }, + { method: "DELETE", ...opts, headers }, timeout, ) } @@ -165,7 +182,7 @@ export class ApiClient extends AbstractFetchClient { resourceGroupName: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_EmployeeListResult> @@ -175,9 +192,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async employeesListBySubscription( @@ -186,7 +208,7 @@ export class ApiClient extends AbstractFetchClient { subscriptionId: t_Azure_Core_uuid }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_EmployeeListResult> @@ -196,9 +218,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/providers/Microsoft.ContosoProviderHub/employees` + const headers = this._headers({}, opts.headers) const query = this._query({ "api-version": p["apiVersion"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async employeesMove( @@ -210,7 +237,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_MoveRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_MoveResponse> @@ -220,13 +247,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/subscriptions/${p["subscriptionId"]}/resourceGroups/${p["resourceGroupName"]}/providers/Microsoft.ContosoProviderHub/employees/${p["employeeName"]}/move` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const query = this._query({ "api-version": p["apiVersion"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "POST", headers, body, ...(opts ?? {}) }, + { method: "POST", body, ...opts, headers }, timeout, ) } diff --git a/integration-tests/typescript-fetch/src/generated/okta.idp.yaml/client.ts b/integration-tests/typescript-fetch/src/generated/okta.idp.yaml/client.ts index c7f90c39..a660c103 100644 --- a/integration-tests/typescript-fetch/src/generated/okta.idp.yaml/client.ts +++ b/integration-tests/typescript-fetch/src/generated/okta.idp.yaml/client.ts @@ -39,7 +39,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_AppAuthenticatorEnrollmentRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_AppAuthenticatorEnrollment> @@ -50,16 +50,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/app-authenticators` - const headers = this._headers({ - "Content-Type": "application/json, okta-version=1.0.0", - }) + const headers = this._headers( + { "Content-Type": "application/json, okta-version=1.0.0" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async verifyAppAuthenticatorPushNotificationChallenge( @@ -68,23 +65,20 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_PushNotificationVerification }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<204, void> | Res<400, void>> > { const url = this.basePath + `/idp/myaccount/app-authenticators/challenge/${p["challengeId"]}/verify` - const headers = this._headers({ - "Content-Type": "application/json;okta-version=1.0.0", - }) + const headers = this._headers( + { "Content-Type": "application/json;okta-version=1.0.0" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async updateAppAuthenticatorEnrollment( @@ -93,7 +87,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_UpdateAppAuthenticatorEnrollmentRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_AppAuthenticatorEnrollment> @@ -104,14 +98,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/idp/myaccount/app-authenticators/${p["enrollmentId"]}` - const headers = this._headers({ - "Content-Type": "application/merge-patch+json;okta-version=1.0.0", - }) + const headers = this._headers( + { "Content-Type": "application/merge-patch+json;okta-version=1.0.0" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "PATCH", headers, body, ...(opts ?? {}) }, + { method: "PATCH", body, ...opts, headers }, timeout, ) } @@ -121,7 +116,7 @@ export class ApiClient extends AbstractFetchClient { enrollmentId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<401, t_Error> | Res<403, t_Error> | Res<404, t_Error> @@ -129,8 +124,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/idp/myaccount/app-authenticators/${p["enrollmentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async listAppAuthenticatorPendingPushNotificationChallenges( @@ -138,7 +134,7 @@ export class ApiClient extends AbstractFetchClient { enrollmentId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_PushNotificationChallenge[]> | Res<401, t_Error> @@ -147,8 +143,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/idp/myaccount/app-authenticators/${p["enrollmentId"]}/push/notifications` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async listAuthenticators( @@ -156,16 +153,21 @@ export class ApiClient extends AbstractFetchClient { expand?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_Authenticator[]> | Res<403, t_Error> | Res<429, t_Error> > > { const url = this.basePath + `/idp/myaccount/authenticators` + const headers = this._headers({}, opts.headers) const query = this._query({ expand: p["expand"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async getAuthenticator( @@ -174,7 +176,7 @@ export class ApiClient extends AbstractFetchClient { expand?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Authenticator> @@ -185,9 +187,14 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/idp/myaccount/authenticators/${p["authenticatorId"]}` + const headers = this._headers({}, opts.headers) const query = this._query({ expand: p["expand"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async listEnrollments( @@ -195,7 +202,7 @@ export class ApiClient extends AbstractFetchClient { authenticatorId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_AuthenticatorEnrollment[]> @@ -207,8 +214,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/idp/myaccount/authenticators/${p["authenticatorId"]}/enrollments` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async getEnrollment( @@ -217,7 +225,7 @@ export class ApiClient extends AbstractFetchClient { enrollmentId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_AuthenticatorEnrollment> @@ -229,17 +237,19 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/idp/myaccount/authenticators/${p["authenticatorId"]}/enrollments/${p["enrollmentId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async listEmails( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, t_Error>>> { const url = this.basePath + `/idp/myaccount/emails` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async createEmail( @@ -254,7 +264,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_Email> @@ -265,14 +275,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/emails` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getEmail( @@ -280,11 +289,12 @@ export class ApiClient extends AbstractFetchClient { id: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, t_Error>>> { const url = this.basePath + `/idp/myaccount/emails/${p["id"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async deleteEmail( @@ -292,15 +302,16 @@ export class ApiClient extends AbstractFetchClient { id: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<400, t_Error> | Res<401, t_Error> | Res<404, t_Error> > > { const url = this.basePath + `/idp/myaccount/emails/${p["id"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async sendEmailChallenge( @@ -311,7 +322,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -345,14 +356,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/emails/${p["id"]}/challenge` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async pollChallengeForEmailMagicLink( @@ -361,7 +371,7 @@ export class ApiClient extends AbstractFetchClient { challengeId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -396,8 +406,9 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/idp/myaccount/emails/${p["id"]}/challenge/${p["challengeId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async verifyEmailOtp( @@ -409,7 +420,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, void> | Res<401, t_Error> | Res<403, t_Error> | Res<404, t_Error> @@ -418,45 +429,47 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/idp/myaccount/emails/${p["id"]}/challenge/${p["challengeId"]}/verify` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async listOktaApplications( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<400, t_Error>> > { const url = this.basePath + `/idp/myaccount/okta-applications` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async getOrganization( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, t_Error>>> { const url = this.basePath + `/idp/myaccount/organization` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async getPassword( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<401, t_Error>> > { const url = this.basePath + `/idp/myaccount/password` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async createPassword( @@ -468,7 +481,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_PasswordResponse> @@ -478,14 +491,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/password` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async replacePassword( @@ -497,7 +509,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_PasswordResponse> @@ -507,34 +519,35 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/password` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async deletePassword( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<401, t_Error> | Res<404, t_Error>> > { const url = this.basePath + `/idp/myaccount/password` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async listPhones( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, t_Error>>> { const url = this.basePath + `/idp/myaccount/phones` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async createPhone( @@ -548,7 +561,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_Phone> @@ -560,14 +573,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/phones` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPhone( @@ -575,15 +587,16 @@ export class ApiClient extends AbstractFetchClient { id: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_Phone> | Res<401, t_Error> | Res<404, t_Error> > > { const url = this.basePath + `/idp/myaccount/phones/${p["id"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async deletePhone( @@ -591,15 +604,16 @@ export class ApiClient extends AbstractFetchClient { id: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<401, t_Error> | Res<403, t_Error> | Res<404, t_Error> > > { const url = this.basePath + `/idp/myaccount/phones/${p["id"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async sendPhoneChallenge( @@ -611,7 +625,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -635,14 +649,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/phones/${p["id"]}/challenge` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async verifyPhoneChallenge( @@ -653,7 +666,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<204, void> @@ -665,23 +678,23 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/idp/myaccount/phones/${p["id"]}/verify` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getProfile( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, t_Error>>> { const url = this.basePath + `/idp/myaccount/profile` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async replaceProfile( @@ -691,40 +704,41 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_Profile> | Res<400, t_Error> | Res<401, t_Error> > > { const url = this.basePath + `/idp/myaccount/profile` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async getProfileSchema( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<401, t_Error>>> { const url = this.basePath + `/idp/myaccount/profile/schema` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async deleteSessions( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res<401, t_Error> | Res<404, t_Error>> > { const url = this.basePath + `/idp/myaccount/sessions` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } } diff --git a/integration-tests/typescript-fetch/src/generated/okta.oauth.yaml/client.ts b/integration-tests/typescript-fetch/src/generated/okta.oauth.yaml/client.ts index afc8b4e2..270b4667 100644 --- a/integration-tests/typescript-fetch/src/generated/okta.oauth.yaml/client.ts +++ b/integration-tests/typescript-fetch/src/generated/okta.oauth.yaml/client.ts @@ -53,12 +53,17 @@ export class ApiClient extends AbstractFetchClient { clientId?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<400, t_Error>>> { const url = this.basePath + `/.well-known/openid-configuration` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async authorize( @@ -85,9 +90,10 @@ export class ApiClient extends AbstractFetchClient { state?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/oauth2/v1/authorize` + const headers = this._headers({}, opts.headers) const query = this._query({ acr_values: p["acrValues"], client_id: p["clientId"], @@ -111,7 +117,11 @@ export class ApiClient extends AbstractFetchClient { state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async bcAuthorize( @@ -119,7 +129,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_BackchannelAuthorizeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_BackchannelAuthorizeResponse> @@ -129,16 +139,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/bc/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async challenge( @@ -146,7 +153,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_ChallengeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_ChallengeResponse> @@ -157,16 +164,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/challenge` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async listClients( @@ -176,20 +180,25 @@ export class ApiClient extends AbstractFetchClient { q?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_Client[]> | Res<403, t_Error> | Res<429, t_Error> > > { const url = this.basePath + `/oauth2/v1/clients` + const headers = this._headers({}, opts.headers) const query = this._query({ after: p["after"], limit: p["limit"], q: p["q"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async createClient( @@ -197,7 +206,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_Client }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<201, t_Client> @@ -207,14 +216,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/clients` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getClient( @@ -222,7 +230,7 @@ export class ApiClient extends AbstractFetchClient { clientId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Client> @@ -232,8 +240,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/clients/${p["clientId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async replaceClient( @@ -242,7 +251,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_Client }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Client> @@ -253,14 +262,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/clients/${p["clientId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async deleteClient( @@ -268,15 +276,16 @@ export class ApiClient extends AbstractFetchClient { clientId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<403, t_Error> | Res<404, t_Error> | Res<429, t_Error> > > { const url = this.basePath + `/oauth2/v1/clients/${p["clientId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async generateNewClientSecret( @@ -284,7 +293,7 @@ export class ApiClient extends AbstractFetchClient { clientId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_Client> @@ -295,8 +304,9 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/oauth2/v1/clients/${p["clientId"]}/lifecycle/newSecret` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "POST", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "POST", ...opts, headers }, timeout) } async deviceAuthorize( @@ -304,7 +314,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_DeviceAuthorizeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_DeviceAuthorizeResponse> @@ -314,16 +324,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/device/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async globalTokenRevocation( @@ -331,21 +338,20 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_GlobalTokenRevocationRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res<400, void> | Res<403, t_Error> | Res<429, t_Error> > > { const url = this.basePath + `/oauth2/v1/global-token-revocation` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async introspect( @@ -353,7 +359,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_IntrospectionRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_IntrospectionResponse> @@ -363,14 +369,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/introspect` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async oauthKeys( @@ -378,12 +383,17 @@ export class ApiClient extends AbstractFetchClient { clientId?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<429, t_Error>>> { const url = this.basePath + `/oauth2/v1/keys` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async logout( @@ -393,16 +403,21 @@ export class ApiClient extends AbstractFetchClient { state?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/oauth2/v1/logout` + const headers = this._headers({}, opts.headers) const query = this._query({ id_token_hint: p["idTokenHint"], post_logout_redirect_uri: p["postLogoutRedirectUri"], state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async logoutWithPost( @@ -410,19 +425,16 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_LogoutWithPost }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/oauth2/v1/logout` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async oobAuthenticate( @@ -430,7 +442,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_OobAuthenticateRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_OobAuthenticateResponse> @@ -441,16 +453,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/oob-authenticate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async parOptions( @@ -458,16 +467,12 @@ export class ApiClient extends AbstractFetchClient { origin?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<429, t_Error>>> { const url = this.basePath + `/oauth2/v1/par` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) - return this._fetch( - url, - { method: "OPTIONS", headers, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "OPTIONS", ...opts, headers }, timeout) } async par( @@ -475,7 +480,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_ParRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_ParResponse> @@ -486,14 +491,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/par` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async revoke( @@ -501,7 +505,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_RevokeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, void> @@ -511,14 +515,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/revoke` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async tokenOptions( @@ -526,16 +529,12 @@ export class ApiClient extends AbstractFetchClient { origin?: string } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<429, t_Error>>> { const url = this.basePath + `/oauth2/v1/token` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) - return this._fetch( - url, - { method: "OPTIONS", headers, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "OPTIONS", ...opts, headers }, timeout) } async token( @@ -543,7 +542,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_TokenRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_TokenResponse> @@ -553,29 +552,27 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/v1/token` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async userinfo( timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_UserInfo> | Res<401, void> | Res<403, void> | Res<429, t_Error> > > { const url = this.basePath + `/oauth2/v1/userinfo` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async getWellKnownOAuthConfigurationCustomAs( @@ -584,7 +581,7 @@ export class ApiClient extends AbstractFetchClient { clientId?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_OAuthMetadata> | Res<400, t_Error> | Res<404, t_Error> @@ -593,9 +590,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/.well-known/oauth-authorization-server` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async getWellKnownOpenIdConfigurationCustomAs( @@ -604,7 +606,7 @@ export class ApiClient extends AbstractFetchClient { clientId?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_OidcMetadata> | Res<400, t_Error> | Res<404, t_Error> @@ -613,9 +615,14 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/.well-known/openid-configuration` + const headers = this._headers({}, opts.headers) const query = this._query({ client_id: p["clientId"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async authorizeCustomAs( @@ -643,10 +650,11 @@ export class ApiClient extends AbstractFetchClient { state?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/authorize` + const headers = this._headers({}, opts.headers) const query = this._query({ acr_values: p["acrValues"], client_id: p["clientId"], @@ -670,7 +678,11 @@ export class ApiClient extends AbstractFetchClient { state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async bcAuthorizeCustomAs( @@ -679,7 +691,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_BackchannelAuthorizeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_BackchannelAuthorizeResponse> @@ -690,16 +702,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/bc/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async challengeCustomAs( @@ -708,7 +717,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_ChallengeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_ChallengeResponse> @@ -720,16 +729,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/challenge` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deviceAuthorizeCustomAs( @@ -738,7 +744,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_DeviceAuthorizeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_DeviceAuthorizeResponse> @@ -750,16 +756,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/device/authorize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async introspectCustomAs( @@ -768,7 +771,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_IntrospectionRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_IntrospectionResponse> @@ -779,14 +782,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/introspect` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async oauthKeysCustomAs( @@ -794,11 +796,12 @@ export class ApiClient extends AbstractFetchClient { authorizationServerId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<429, t_Error>>> { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/keys` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async logoutCustomAs( @@ -809,17 +812,22 @@ export class ApiClient extends AbstractFetchClient { state?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/logout` + const headers = this._headers({}, opts.headers) const query = this._query({ id_token_hint: p["idTokenHint"], post_logout_redirect_uri: p["postLogoutRedirectUri"], state: p["state"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async logoutCustomAsWithPost( @@ -828,20 +836,17 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_LogoutWithPost }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/logout` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async oobAuthenticateCustomAs( @@ -850,7 +855,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_OobAuthenticateRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_OobAuthenticateResponse> @@ -863,16 +868,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/oob-authenticate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async parOptionsCustomAs( @@ -881,16 +883,12 @@ export class ApiClient extends AbstractFetchClient { origin?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<429, t_Error>>> { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/par` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) - return this._fetch( - url, - { method: "OPTIONS", headers, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "OPTIONS", ...opts, headers }, timeout) } async parCustomAs( @@ -899,7 +897,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_ParRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_ParResponse> @@ -910,14 +908,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/par` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async revokeCustomAs( @@ -926,7 +923,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_RevokeRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, void> @@ -937,14 +934,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/revoke` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async tokenOptionsCustomAs( @@ -953,16 +949,12 @@ export class ApiClient extends AbstractFetchClient { origin?: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res<429, t_Error>>> { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/token` - const headers = this._headers({ Origin: p["origin"] }) + const headers = this._headers({ Origin: p["origin"] }, opts.headers) - return this._fetch( - url, - { method: "OPTIONS", headers, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "OPTIONS", ...opts, headers }, timeout) } async tokenCustomAs( @@ -971,7 +963,7 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_TokenRequest }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_TokenResponse> @@ -981,16 +973,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/token` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async userinfoCustomAs( @@ -998,7 +987,7 @@ export class ApiClient extends AbstractFetchClient { authorizationServerId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_UserInfo> | Res<401, void> | Res<403, void> | Res<429, t_Error> @@ -1006,7 +995,8 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/oauth2/${p["authorizationServerId"]}/v1/userinfo` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } } diff --git a/integration-tests/typescript-fetch/src/generated/petstore-expanded.yaml/client.ts b/integration-tests/typescript-fetch/src/generated/petstore-expanded.yaml/client.ts index ec761661..e8ef5c48 100644 --- a/integration-tests/typescript-fetch/src/generated/petstore-expanded.yaml/client.ts +++ b/integration-tests/typescript-fetch/src/generated/petstore-expanded.yaml/client.ts @@ -24,12 +24,17 @@ export class ApiClient extends AbstractFetchClient { limit?: number } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/pets` + const headers = this._headers({}, opts.headers) const query = this._query({ tags: p["tags"], limit: p["limit"] }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async addPet( @@ -37,17 +42,16 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_NewPet }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/pets` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async findPetById( @@ -55,11 +59,12 @@ export class ApiClient extends AbstractFetchClient { id: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/pets/${p["id"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async deletePet( @@ -67,10 +72,11 @@ export class ApiClient extends AbstractFetchClient { id: number }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/pets/${p["id"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } } diff --git a/integration-tests/typescript-fetch/src/generated/stripe.yaml/client.ts b/integration-tests/typescript-fetch/src/generated/stripe.yaml/client.ts index b6a454b4..d855c2af 100644 --- a/integration-tests/typescript-fetch/src/generated/stripe.yaml/client.ts +++ b/integration-tests/typescript-fetch/src/generated/stripe.yaml/client.ts @@ -179,20 +179,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/account` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -213,21 +214,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/account_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postAccountSessions( @@ -310,21 +308,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/account_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAccounts( @@ -344,7 +339,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -360,9 +355,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -374,7 +370,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -843,21 +839,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteAccountsAccount( @@ -866,19 +859,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -890,20 +884,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1345,21 +1340,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postAccountsAccountBankAccounts( @@ -1392,21 +1384,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/bank_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteAccountsAccountBankAccountsId( @@ -1416,7 +1405,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_external_account> | Res @@ -1424,14 +1413,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/accounts/${p["account"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -1444,21 +1434,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1495,22 +1486,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAccountsAccountCapabilities( @@ -1520,7 +1508,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -1536,15 +1524,16 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/accounts/${p["account"]}/capabilities` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1557,22 +1546,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/capabilities/${p["capability"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1587,23 +1577,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/capabilities/${p["capability"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAccountsAccountExternalAccounts( @@ -1617,7 +1604,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -1633,9 +1620,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/accounts/${p["account"]}/external_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -1647,7 +1635,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1682,21 +1670,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/external_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteAccountsAccountExternalAccountsId( @@ -1706,7 +1691,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_external_account> | Res @@ -1715,14 +1700,15 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/accounts/${p["account"]}/external_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -1735,22 +1721,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/external_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1787,23 +1774,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/external_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postAccountsAccountLoginLinks( @@ -1814,21 +1798,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/login_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAccountsAccountPeople( @@ -1848,7 +1829,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -1864,9 +1845,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/accounts/${p["account"]}/people` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -1878,7 +1860,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -1991,21 +1973,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/people` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteAccountsAccountPeoplePerson( @@ -2015,20 +1994,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/people/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -2041,21 +2021,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/people/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2169,22 +2150,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/people/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAccountsAccountPersons( @@ -2204,7 +2182,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2220,9 +2198,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/accounts/${p["account"]}/persons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -2234,7 +2213,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2347,21 +2326,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/persons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteAccountsAccountPersonsPerson( @@ -2371,20 +2347,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/persons/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -2397,21 +2374,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/persons/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2525,22 +2503,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/persons/${p["person"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postAccountsAccountReject( @@ -2552,21 +2527,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/accounts/${p["account"]}/reject` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getApplePayDomains( @@ -2579,7 +2551,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2595,9 +2567,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/apple_pay/domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ domain_name: p["domainName"], ending_before: p["endingBefore"], @@ -2609,7 +2582,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2622,21 +2595,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/apple_pay/domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteApplePayDomainsDomain( @@ -2645,21 +2615,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_apple_pay_domain> | Res > > { const url = this.basePath + `/v1/apple_pay/domains/${p["domain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -2671,20 +2642,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/apple_pay/domains/${p["domain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2707,7 +2679,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2723,9 +2695,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/application_fees` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -2738,7 +2711,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2751,21 +2724,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/application_fees/${p["fee"]}/refunds/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2784,22 +2758,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/application_fees/${p["fee"]}/refunds/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getApplicationFeesId( @@ -2809,20 +2780,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/application_fees/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2837,21 +2809,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/application_fees/${p["id"]}/refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getApplicationFeesIdRefunds( @@ -2864,7 +2833,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2880,9 +2849,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/application_fees/${p["id"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -2893,7 +2863,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2910,21 +2880,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/application_fees/${p["id"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAppsSecrets( @@ -2940,7 +2907,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -2956,9 +2923,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/apps/secrets` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -2970,7 +2938,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -2989,21 +2957,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/apps/secrets` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postAppsSecretsDelete( @@ -3018,21 +2983,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/apps/secrets/delete` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getAppsSecretsFind( @@ -3046,14 +3008,15 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/apps/secrets/find` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], name: p["name"], @@ -3063,7 +3026,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3074,20 +3037,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3113,7 +3077,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3129,9 +3093,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/balance/history` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], currency: p["currency"], @@ -3147,7 +3112,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3159,22 +3124,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_balance_transaction> | Res > > { const url = this.basePath + `/v1/balance/history/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3200,7 +3166,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3216,9 +3182,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], currency: p["currency"], @@ -3234,7 +3201,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3246,22 +3213,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_balance_transaction> | Res > > { const url = this.basePath + `/v1/balance_transactions/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3277,7 +3245,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3293,9 +3261,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/billing/alerts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ alert_type: p["alertType"], ending_before: p["endingBefore"], @@ -3308,7 +3277,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3330,21 +3299,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/alerts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getBillingAlertsId( @@ -3354,20 +3320,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/alerts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3380,21 +3347,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/alerts/${p["id"]}/activate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postBillingAlertsIdArchive( @@ -3405,21 +3369,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/alerts/${p["id"]}/archive` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postBillingAlertsIdDeactivate( @@ -3430,21 +3391,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/alerts/${p["id"]}/deactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postBillingMeterEventAdjustments( @@ -3459,23 +3417,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_billing_meter_event_adjustment> | Res > > { const url = this.basePath + `/v1/billing/meter_event_adjustments` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postBillingMeterEvents( @@ -3491,23 +3446,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_billing_meter_event> | Res > > { const url = this.basePath + `/v1/billing/meter_events` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getBillingMeters( @@ -3520,7 +3472,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3536,9 +3488,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/billing/meters` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -3550,7 +3503,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3575,21 +3528,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/meters` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getBillingMetersId( @@ -3599,20 +3549,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/meters/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3626,21 +3577,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/meters/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postBillingMetersIdDeactivate( @@ -3651,21 +3599,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/meters/${p["id"]}/deactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getBillingMetersIdEventSummaries( @@ -3682,7 +3627,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3698,9 +3643,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/billing/meters/${p["id"]}/event_summaries` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], end_time: p["endTime"], @@ -3715,7 +3661,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3728,21 +3674,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/billing/meters/${p["id"]}/reactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getBillingPortalConfigurations( @@ -3756,7 +3699,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -3772,9 +3715,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/billing_portal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], ending_before: p["endingBefore"], @@ -3787,7 +3731,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3865,23 +3809,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_billing_portal_configuration> | Res > > { const url = this.basePath + `/v1/billing_portal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getBillingPortalConfigurationsConfiguration( @@ -3891,7 +3832,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_billing_portal_configuration> | Res @@ -3899,15 +3840,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/billing_portal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -3989,7 +3931,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_billing_portal_configuration> | Res @@ -3997,16 +3939,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/billing_portal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postBillingPortalSessions( @@ -4108,23 +4047,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_billing_portal_session> | Res > > { const url = this.basePath + `/v1/billing_portal/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCharges( @@ -4147,7 +4083,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4163,9 +4099,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/charges` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -4180,7 +4117,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -4256,21 +4193,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getChargesSearch( @@ -4282,7 +4216,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4300,9 +4234,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/charges/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -4313,7 +4248,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -4325,20 +4260,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -4377,21 +4313,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postChargesChargeCapture( @@ -4412,21 +4345,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getChargesChargeDispute( @@ -4436,20 +4366,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/dispute` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -4497,21 +4428,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/dispute` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postChargesChargeDisputeClose( @@ -4522,21 +4450,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/dispute/close` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postChargesChargeRefund( @@ -4558,21 +4483,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getChargesChargeRefunds( @@ -4585,7 +4507,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4601,9 +4523,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/charges/${p["charge"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -4614,7 +4537,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -4641,21 +4564,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getChargesChargeRefundsRefund( @@ -4666,21 +4586,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -4699,22 +4620,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/charges/${p["charge"]}/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCheckoutSessions( @@ -4742,7 +4660,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -4758,9 +4676,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/checkout/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -4778,7 +4697,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5561,21 +5480,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/checkout/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCheckoutSessionsSession( @@ -5585,20 +5501,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/checkout/sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5616,21 +5533,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/checkout/sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postCheckoutSessionsSessionExpire( @@ -5641,21 +5555,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/checkout/sessions/${p["session"]}/expire` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCheckoutSessionsSessionLineItems( @@ -5668,7 +5579,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5685,9 +5596,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/checkout/sessions/${p["session"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5698,7 +5610,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5712,7 +5624,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5728,9 +5640,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/climate/orders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5741,7 +5654,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5763,21 +5676,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/climate/orders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getClimateOrdersOrder( @@ -5787,20 +5697,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/climate/orders/${p["order"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5821,21 +5732,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/climate/orders/${p["order"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postClimateOrdersOrderCancel( @@ -5846,21 +5754,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/climate/orders/${p["order"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getClimateProducts( @@ -5872,7 +5777,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5888,9 +5793,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/climate/products` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5901,7 +5807,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5913,20 +5819,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/climate/products/${p["product"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5940,7 +5847,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -5956,9 +5863,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/climate/suppliers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -5969,7 +5877,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -5981,20 +5889,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/climate/suppliers/${p["supplier"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6006,7 +5915,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_confirmation_token> | Res @@ -6014,15 +5923,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/confirmation_tokens/${p["confirmationToken"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6036,7 +5946,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6052,9 +5962,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/country_specs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -6065,7 +5976,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6077,20 +5988,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/country_specs/${p["country"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6112,7 +6024,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6128,9 +6040,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/coupons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -6142,7 +6055,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6178,21 +6091,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/coupons` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCouponsCoupon( @@ -6201,19 +6111,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/coupons/${p["coupon"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -6225,20 +6136,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/coupons/${p["coupon"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6264,21 +6176,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/coupons/${p["coupon"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCreditNotes( @@ -6300,7 +6209,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6316,9 +6225,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/credit_notes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -6332,7 +6242,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6381,21 +6291,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/credit_notes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCreditNotesPreview( @@ -6441,14 +6348,15 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/credit_notes/preview` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ amount: p["amount"], credit_amount: p["creditAmount"], @@ -6469,7 +6377,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6520,7 +6428,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6536,9 +6444,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/credit_notes/preview/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ amount: p["amount"], credit_amount: p["creditAmount"], @@ -6562,7 +6471,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6577,7 +6486,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6593,9 +6502,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/credit_notes/${p["creditNote"]}/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -6606,7 +6516,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6618,20 +6528,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/credit_notes/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6648,21 +6559,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/credit_notes/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postCreditNotesIdVoid( @@ -6673,21 +6581,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/credit_notes/${p["id"]}/void` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postCustomerSessions( @@ -6721,21 +6626,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customer_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomers( @@ -6757,7 +6659,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6773,9 +6675,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], email: p["email"], @@ -6789,7 +6692,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -6948,21 +6851,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersSearch( @@ -6974,7 +6874,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -6992,9 +6892,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -7005,7 +6906,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7016,19 +6917,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -7040,22 +6942,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_customer | t_deleted_customer> | Res > > { const url = this.basePath + `/v1/customers/${p["customer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7170,21 +7073,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerBalanceTransactions( @@ -7197,7 +7097,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -7214,9 +7114,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7227,7 +7128,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7248,7 +7149,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_customer_balance_transaction> | Res @@ -7256,16 +7157,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerBalanceTransactionsTransaction( @@ -7276,7 +7174,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_customer_balance_transaction> | Res @@ -7285,15 +7183,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/customers/${p["customer"]}/balance_transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7313,7 +7212,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_customer_balance_transaction> | Res @@ -7322,16 +7221,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/customers/${p["customer"]}/balance_transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerBankAccounts( @@ -7344,7 +7240,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -7360,9 +7256,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/${p["customer"]}/bank_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7373,7 +7270,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7421,21 +7318,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/bank_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCustomersCustomerBankAccountsId( @@ -7447,7 +7341,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_payment_source | t_deleted_payment_source> @@ -7456,14 +7350,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -7476,21 +7371,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7533,7 +7429,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_card | t_bank_account | t_source> | Res @@ -7541,16 +7437,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postCustomersCustomerBankAccountsIdVerify( @@ -7563,23 +7456,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/bank_accounts/${p["id"]}/verify` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerCards( @@ -7592,7 +7482,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -7608,9 +7498,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/${p["customer"]}/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7621,7 +7512,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7669,21 +7560,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCustomersCustomerCardsId( @@ -7695,7 +7583,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_payment_source | t_deleted_payment_source> @@ -7704,14 +7592,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/cards/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -7724,19 +7613,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/customers/${p["customer"]}/cards/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7779,7 +7669,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_card | t_bank_account | t_source> | Res @@ -7787,16 +7677,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/cards/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerCashBalance( @@ -7806,20 +7693,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/cash_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7835,21 +7723,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/cash_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerCashBalanceTransactions( @@ -7862,7 +7747,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -7879,9 +7764,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/cash_balance_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -7892,7 +7778,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7905,7 +7791,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_customer_cash_balance_transaction> | Res @@ -7914,15 +7800,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/customers/${p["customer"]}/cash_balance_transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7933,19 +7820,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -7957,20 +7845,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -7997,7 +7886,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_funding_instructions> | Res @@ -8005,16 +7894,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/funding_instructions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerPaymentMethods( @@ -8066,7 +7952,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -8082,9 +7968,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/${p["customer"]}/payment_methods` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ allow_redisplay: p["allowRedisplay"], ending_before: p["endingBefore"], @@ -8097,7 +7984,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -8110,22 +7997,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/payment_methods/${p["paymentMethod"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -8141,7 +8029,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -8157,9 +8045,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/${p["customer"]}/sources` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -8171,7 +8060,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -8219,21 +8108,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/sources` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCustomersCustomerSourcesId( @@ -8245,7 +8131,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_payment_source | t_deleted_payment_source> @@ -8254,14 +8140,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/sources/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -8274,21 +8161,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/sources/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -8331,7 +8219,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_card | t_bank_account | t_source> | Res @@ -8339,16 +8227,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/customers/${p["customer"]}/sources/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postCustomersCustomerSourcesIdVerify( @@ -8361,22 +8246,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/sources/${p["id"]}/verify` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getCustomersCustomerSubscriptions( @@ -8389,7 +8271,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -8405,9 +8287,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -8418,7 +8301,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -8659,21 +8542,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCustomersCustomerSubscriptionsSubscriptionExposedId( @@ -8687,21 +8567,22 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -8714,22 +8595,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -8995,23 +8877,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount( @@ -9021,21 +8900,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -9048,22 +8928,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/subscriptions/${p["subscriptionExposedId"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9078,7 +8959,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9094,9 +8975,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/customers/${p["customer"]}/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -9107,7 +8989,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9195,21 +9077,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteCustomersCustomerTaxIdsId( @@ -9219,20 +9098,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -9245,21 +9125,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/customers/${p["customer"]}/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9283,7 +9164,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9299,9 +9180,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/disputes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -9315,7 +9197,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9327,20 +9209,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9388,21 +9271,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postDisputesDisputeClose( @@ -9413,21 +9293,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/disputes/${p["dispute"]}/close` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getEntitlementsActiveEntitlements( @@ -9440,7 +9317,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9456,9 +9333,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/entitlements/active_entitlements` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], ending_before: p["endingBefore"], @@ -9470,7 +9348,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9482,7 +9360,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_entitlements_active_entitlement> | Res @@ -9490,15 +9368,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/entitlements/active_entitlements/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9514,7 +9393,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9530,9 +9409,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/entitlements/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ archived: p["archived"], ending_before: p["endingBefore"], @@ -9545,7 +9425,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9562,23 +9442,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_entitlements_feature> | Res > > { const url = this.basePath + `/v1/entitlements/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getEntitlementsFeaturesId( @@ -9588,22 +9465,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_entitlements_feature> | Res > > { const url = this.basePath + `/v1/entitlements/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9623,23 +9501,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_entitlements_feature> | Res > > { const url = this.basePath + `/v1/entitlements/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postEphemeralKeys( @@ -9653,21 +9528,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/ephemeral_keys` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteEphemeralKeysKey( @@ -9678,19 +9550,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/ephemeral_keys/${p["key"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -9715,7 +9588,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9731,9 +9604,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/events` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], delivery_success: p["deliverySuccess"], @@ -9748,7 +9622,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9760,18 +9634,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/events/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9785,7 +9660,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9801,9 +9676,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/exchange_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -9814,7 +9690,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9826,20 +9702,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/exchange_rates/${p["rateId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9863,7 +9740,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -9879,9 +9756,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/file_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -9895,7 +9773,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9914,21 +9792,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/file_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getFileLinksLink( @@ -9938,20 +9813,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/file_links/${p["link"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -9970,21 +9846,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/file_links/${p["link"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getFiles( @@ -10020,7 +9893,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10036,9 +9909,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/files` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -10051,7 +9925,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10084,17 +9958,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/files` - const headers = this._headers({ "Content-Type": "multipart/form-data" }) + const headers = this._headers( + { "Content-Type": "multipart/form-data" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getFilesFile( @@ -10104,18 +9977,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/files/${p["file"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10134,7 +10008,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10150,9 +10024,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/financial_connections/accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ account_holder: p["accountHolder"], ending_before: p["endingBefore"], @@ -10165,7 +10040,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10177,7 +10052,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res @@ -10185,15 +10060,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/financial_connections/accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10206,7 +10082,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res @@ -10215,16 +10091,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/financial_connections/accounts/${p["account"]}/disconnect` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getFinancialConnectionsAccountsAccountOwners( @@ -10238,7 +10111,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10256,9 +10129,10 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/financial_connections/accounts/${p["account"]}/owners` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -10270,7 +10144,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10284,7 +10158,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res @@ -10293,16 +10167,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/financial_connections/accounts/${p["account"]}/refresh` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postFinancialConnectionsAccountsAccountSubscribe( @@ -10314,7 +10185,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res @@ -10323,16 +10194,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/financial_connections/accounts/${p["account"]}/subscribe` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postFinancialConnectionsAccountsAccountUnsubscribe( @@ -10344,7 +10212,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res @@ -10353,16 +10221,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/financial_connections/accounts/${p["account"]}/unsubscribe` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postFinancialConnectionsSessions( @@ -10395,23 +10260,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_session> | Res > > { const url = this.basePath + `/v1/financial_connections/sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getFinancialConnectionsSessionsSession( @@ -10421,7 +10283,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_session> | Res @@ -10429,15 +10291,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/financial_connections/sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10463,7 +10326,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10479,9 +10342,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/financial_connections/transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ account: p["account"], ending_before: p["endingBefore"], @@ -10495,7 +10359,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10507,7 +10371,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_transaction> | Res @@ -10516,15 +10380,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/financial_connections/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10544,7 +10409,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10560,9 +10425,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/forwarding/requests` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -10574,7 +10440,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10601,23 +10467,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_forwarding_request> | Res > > { const url = this.basePath + `/v1/forwarding/requests` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getForwardingRequestsId( @@ -10627,22 +10490,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_forwarding_request> | Res > > { const url = this.basePath + `/v1/forwarding/requests/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10667,7 +10531,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10683,9 +10547,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/identity/verification_reports` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_reference_id: p["clientReferenceId"], created: p["created"], @@ -10700,7 +10565,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10712,7 +10577,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_identity_verification_report> | Res @@ -10720,15 +10585,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/identity/verification_reports/${p["report"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10753,7 +10619,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -10769,9 +10635,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/identity/verification_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_reference_id: p["clientReferenceId"], created: p["created"], @@ -10786,7 +10653,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10820,23 +10687,20 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_identity_verification_session> | Res > > { const url = this.basePath + `/v1/identity/verification_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIdentityVerificationSessionsSession( @@ -10846,7 +10710,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_identity_verification_session> | Res @@ -10854,15 +10718,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/identity/verification_sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -10893,7 +10758,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_identity_verification_session> | Res @@ -10901,16 +10766,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/identity/verification_sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postIdentityVerificationSessionsSessionCancel( @@ -10921,7 +10783,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_identity_verification_session> | Res @@ -10930,16 +10792,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/identity/verification_sessions/${p["session"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postIdentityVerificationSessionsSessionRedact( @@ -10950,7 +10809,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_identity_verification_session> | Res @@ -10959,16 +10818,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/identity/verification_sessions/${p["session"]}/redact` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getInvoiceitems( @@ -10991,7 +10847,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -11007,9 +10863,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/invoiceitems` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -11024,7 +10881,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -11073,21 +10930,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoiceitems` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteInvoiceitemsInvoiceitem( @@ -11096,21 +10950,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_invoiceitem> | Res > > { const url = this.basePath + `/v1/invoiceitems/${p["invoiceitem"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -11122,20 +10977,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoiceitems/${p["invoiceitem"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -11181,21 +11037,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoiceitems/${p["invoiceitem"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getInvoices( @@ -11227,7 +11080,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -11243,9 +11096,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/invoices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ collection_method: p["collectionMethod"], created: p["created"], @@ -11262,7 +11116,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -11484,21 +11338,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesCreatePreview( @@ -11828,21 +11679,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/create_preview` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getInvoicesSearch( @@ -11854,7 +11702,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -11872,9 +11720,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/invoices/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -11885,7 +11734,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -12265,14 +12114,15 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/upcoming` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ automatic_tax: p["automaticTax"], coupon: p["coupon"], @@ -12305,7 +12155,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -12688,7 +12538,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -12704,9 +12554,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/invoices/upcoming/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ automatic_tax: p["automaticTax"], coupon: p["coupon"], @@ -12742,7 +12593,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -12753,19 +12604,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -12777,20 +12629,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -13014,21 +12867,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceAddLines( @@ -13113,21 +12963,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/add_lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceFinalize( @@ -13139,21 +12986,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/finalize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getInvoicesInvoiceLines( @@ -13166,7 +13010,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -13182,9 +13026,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -13195,7 +13040,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -13275,22 +13120,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/lines/${p["lineItemId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceMarkUncollectible( @@ -13301,22 +13143,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/mark_uncollectible` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoicePay( @@ -13333,21 +13172,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/pay` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceRemoveLines( @@ -13367,21 +13203,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/remove_lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceSend( @@ -13392,21 +13225,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/send` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceUpdateLines( @@ -13491,21 +13321,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/update_lines` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postInvoicesInvoiceVoid( @@ -13516,21 +13343,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/invoices/${p["invoice"]}/void` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingAuthorizations( @@ -13553,7 +13377,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -13569,9 +13393,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/authorizations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ card: p["card"], cardholder: p["cardholder"], @@ -13586,7 +13411,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -13598,7 +13423,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -13606,15 +13431,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/issuing/authorizations/${p["authorization"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -13632,7 +13458,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -13640,16 +13466,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/issuing/authorizations/${p["authorization"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postIssuingAuthorizationsAuthorizationApprove( @@ -13666,7 +13489,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -13674,16 +13497,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/issuing/authorizations/${p["authorization"]}/approve` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postIssuingAuthorizationsAuthorizationDecline( @@ -13699,7 +13519,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -13707,16 +13527,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/issuing/authorizations/${p["authorization"]}/decline` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingCardholders( @@ -13740,7 +13557,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -13756,9 +13573,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/cardholders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], email: p["email"], @@ -13774,7 +13592,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -14736,23 +14554,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_cardholder> | Res > > { const url = this.basePath + `/v1/issuing/cardholders` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingCardholdersCardholder( @@ -14762,22 +14577,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_cardholder> | Res > > { const url = this.basePath + `/v1/issuing/cardholders/${p["cardholder"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -15738,23 +15554,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_cardholder> | Res > > { const url = this.basePath + `/v1/issuing/cardholders/${p["cardholder"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingCards( @@ -15781,7 +15594,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -15797,9 +15610,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ cardholder: p["cardholder"], created: p["created"], @@ -15818,7 +15632,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -16774,21 +16588,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/cards` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingCardsCard( @@ -16798,20 +16609,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/cards/${p["card"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -17764,21 +17576,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/cards/${p["card"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingDisputes( @@ -17800,7 +17609,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -17816,9 +17625,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/disputes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -17832,7 +17642,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -17935,21 +17745,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/disputes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingDisputesDispute( @@ -17959,20 +17766,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18074,21 +17882,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/disputes/${p["dispute"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postIssuingDisputesDisputeSubmit( @@ -18104,21 +17909,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/disputes/${p["dispute"]}/submit` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingPersonalizationDesigns( @@ -18136,7 +17938,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18152,9 +17954,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/personalization_designs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -18168,7 +17971,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18197,23 +18000,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_personalization_design> | Res > > { const url = this.basePath + `/v1/issuing/personalization_designs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingPersonalizationDesignsPersonalizationDesign( @@ -18223,7 +18023,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_personalization_design> | Res @@ -18232,15 +18032,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/issuing/personalization_designs/${p["personalizationDesign"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18272,7 +18073,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_personalization_design> | Res @@ -18281,16 +18082,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/issuing/personalization_designs/${p["personalizationDesign"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingPhysicalBundles( @@ -18304,7 +18102,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18320,9 +18118,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/physical_bundles` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -18335,7 +18134,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18347,7 +18146,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_physical_bundle> | Res @@ -18355,15 +18154,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/issuing/physical_bundles/${p["physicalBundle"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18375,22 +18175,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_settlement> | Res > > { const url = this.basePath + `/v1/issuing/settlements/${p["settlement"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18406,23 +18207,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_settlement> | Res > > { const url = this.basePath + `/v1/issuing/settlements/${p["settlement"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingTokens( @@ -18444,7 +18242,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18460,9 +18258,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ card: p["card"], created: p["created"], @@ -18476,7 +18275,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18488,20 +18287,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/tokens/${p["token"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18515,21 +18315,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/issuing/tokens/${p["token"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getIssuingTransactions( @@ -18552,7 +18349,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18568,9 +18365,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/issuing/transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ card: p["card"], cardholder: p["cardholder"], @@ -18585,7 +18383,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18597,22 +18395,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_transaction> | Res > > { const url = this.basePath + `/v1/issuing/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18630,23 +18429,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_transaction> | Res > > { const url = this.basePath + `/v1/issuing/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postLinkAccountSessions( @@ -18679,23 +18475,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_session> | Res > > { const url = this.basePath + `/v1/link_account_sessions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getLinkAccountSessionsSession( @@ -18705,22 +18498,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_session> | Res > > { const url = this.basePath + `/v1/link_account_sessions/${p["session"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18739,7 +18533,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18755,9 +18549,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/linked_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ account_holder: p["accountHolder"], ending_before: p["endingBefore"], @@ -18770,7 +18565,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18782,22 +18577,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res > > { const url = this.basePath + `/v1/linked_accounts/${p["account"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18810,23 +18606,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res > > { const url = this.basePath + `/v1/linked_accounts/${p["account"]}/disconnect` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getLinkedAccountsAccountOwners( @@ -18840,7 +18633,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18856,9 +18649,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/linked_accounts/${p["account"]}/owners` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -18870,7 +18664,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18884,23 +18678,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_financial_connections_account> | Res > > { const url = this.basePath + `/v1/linked_accounts/${p["account"]}/refresh` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getMandatesMandate( @@ -18910,20 +18701,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/mandates/${p["mandate"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -18946,7 +18738,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -18962,9 +18754,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payment_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -18977,7 +18770,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -19697,21 +19490,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentIntentsSearch( @@ -19723,7 +19513,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -19741,9 +19531,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payment_intents/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -19754,7 +19545,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -19767,14 +19558,15 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_secret: p["clientSecret"], expand: p["expand"], @@ -19783,7 +19575,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -20478,21 +20270,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentIntentsIntentApplyCustomerBalance( @@ -20505,23 +20294,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}/apply_customer_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentIntentsIntentCancel( @@ -20537,21 +20323,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentIntentsIntentCapture( @@ -20575,21 +20358,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}/capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentIntentsIntentConfirm( @@ -21297,21 +21077,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}/confirm` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentIntentsIntentIncrementAuthorization( @@ -21332,23 +21109,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}/increment_authorization` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentIntentsIntentVerifyMicrodeposits( @@ -21362,22 +21136,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_intents/${p["intent"]}/verify_microdeposits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentLinks( @@ -21390,7 +21161,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -21406,9 +21177,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payment_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], ending_before: p["endingBefore"], @@ -21420,7 +21192,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -21876,21 +21648,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_links` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentLinksPaymentLink( @@ -21900,20 +21669,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_links/${p["paymentLink"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -22359,21 +22129,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_links/${p["paymentLink"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentLinksPaymentLinkLineItems( @@ -22386,7 +22153,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -22403,9 +22170,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/payment_links/${p["paymentLink"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -22416,7 +22184,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -22431,7 +22199,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -22447,9 +22215,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payment_method_configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ application: p["application"], ending_before: p["endingBefore"], @@ -22461,7 +22230,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -22680,23 +22449,20 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_configuration> | Res > > { const url = this.basePath + `/v1/payment_method_configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentMethodConfigurationsConfiguration( @@ -22706,7 +22472,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_configuration> | Res @@ -22714,15 +22480,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/payment_method_configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -22942,7 +22709,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_configuration> | Res @@ -22950,16 +22717,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/payment_method_configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentMethodDomains( @@ -22973,7 +22737,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -22989,9 +22753,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payment_method_domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ domain_name: p["domainName"], enabled: p["enabled"], @@ -23004,7 +22769,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23018,23 +22783,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_domain> | Res > > { const url = this.basePath + `/v1/payment_method_domains` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentMethodDomainsPaymentMethodDomain( @@ -23044,7 +22806,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_domain> | Res @@ -23052,15 +22814,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/payment_method_domains/${p["paymentMethodDomain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23074,7 +22837,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_domain> | Res @@ -23082,16 +22845,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/payment_method_domains/${p["paymentMethodDomain"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentMethodDomainsPaymentMethodDomainValidate( @@ -23102,7 +22862,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_payment_method_domain> | Res @@ -23111,16 +22871,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/payment_method_domains/${p["paymentMethodDomain"]}/validate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentMethods( @@ -23171,7 +22928,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -23187,9 +22944,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payment_methods` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], ending_before: p["endingBefore"], @@ -23202,7 +22960,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23454,21 +23212,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_methods` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPaymentMethodsPaymentMethod( @@ -23478,20 +23233,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_methods/${p["paymentMethod"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23537,21 +23293,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_methods/${p["paymentMethod"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentMethodsPaymentMethodAttach( @@ -23563,22 +23316,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_methods/${p["paymentMethod"]}/attach` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPaymentMethodsPaymentMethodDetach( @@ -23589,22 +23339,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payment_methods/${p["paymentMethod"]}/detach` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPayouts( @@ -23634,7 +23381,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -23650,9 +23397,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/payouts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ arrival_date: p["arrivalDate"], created: p["created"], @@ -23667,7 +23415,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23689,21 +23437,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payouts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPayoutsPayout( @@ -23713,20 +23458,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payouts/${p["payout"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23744,21 +23490,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payouts/${p["payout"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPayoutsPayoutCancel( @@ -23769,21 +23512,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payouts/${p["payout"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postPayoutsPayoutReverse( @@ -23797,21 +23537,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/payouts/${p["payout"]}/reverse` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPlans( @@ -23833,7 +23570,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -23849,9 +23586,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/plans` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -23865,7 +23603,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23920,19 +23658,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/plans` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deletePlansPlan( @@ -23941,19 +23676,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/plans/${p["plan"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -23965,18 +23701,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/plans/${p["plan"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -23998,19 +23735,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/plans/${p["plan"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPrices( @@ -24040,7 +23774,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24056,9 +23790,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/prices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -24076,7 +23811,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24159,19 +23894,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/prices` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPricesSearch( @@ -24183,7 +23915,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24201,9 +23933,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/prices/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -24214,7 +23947,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24226,18 +23959,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/prices/${p["price"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24284,19 +24018,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/prices/${p["price"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getProducts( @@ -24320,7 +24051,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24336,9 +24067,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/products` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -24354,7 +24086,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24420,21 +24152,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/products` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getProductsSearch( @@ -24446,7 +24175,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24464,9 +24193,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/products/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -24477,7 +24207,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24488,19 +24218,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/products/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -24512,20 +24243,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/products/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24566,21 +24298,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/products/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getProductsProductFeatures( @@ -24593,7 +24322,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24609,9 +24338,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/products/${p["product"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -24622,7 +24352,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24636,21 +24366,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/products/${p["product"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteProductsProductFeaturesId( @@ -24660,7 +24387,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_product_feature> | Res @@ -24668,14 +24395,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/products/${p["product"]}/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -24688,21 +24416,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/products/${p["product"]}/features/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24728,7 +24457,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24744,9 +24473,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/promotion_codes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], code: p["code"], @@ -24762,7 +24492,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24795,21 +24525,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/promotion_codes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getPromotionCodesPromotionCode( @@ -24819,20 +24546,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/promotion_codes/${p["promotionCode"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -24860,21 +24588,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/promotion_codes/${p["promotionCode"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getQuotes( @@ -24889,7 +24614,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -24905,9 +24630,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/quotes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ customer: p["customer"], ending_before: p["endingBefore"], @@ -24921,7 +24647,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25010,19 +24736,16 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getQuotesQuote( @@ -25032,18 +24755,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes/${p["quote"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25129,19 +24853,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes/${p["quote"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postQuotesQuoteAccept( @@ -25152,19 +24873,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes/${p["quote"]}/accept` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postQuotesQuoteCancel( @@ -25175,19 +24893,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes/${p["quote"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getQuotesQuoteComputedUpfrontLineItems( @@ -25200,7 +24915,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25217,9 +24932,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/quotes/${p["quote"]}/computed_upfront_line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -25230,7 +24946,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25244,19 +24960,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes/${p["quote"]}/finalize` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getQuotesQuoteLineItems( @@ -25269,7 +24982,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25285,9 +24998,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/quotes/${p["quote"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -25298,7 +25012,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25310,18 +25024,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/quotes/${p["quote"]}/pdf` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25345,7 +25060,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25361,9 +25076,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/radar/early_fraud_warnings` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -25377,7 +25093,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25389,7 +25105,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_radar_early_fraud_warning> | Res @@ -25397,15 +25113,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/radar/early_fraud_warnings/${p["earlyFraudWarning"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25429,7 +25146,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25445,9 +25162,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/radar/value_list_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -25461,7 +25179,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25475,23 +25193,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_radar_value_list_item> | Res > > { const url = this.basePath + `/v1/radar/value_list_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteRadarValueListItemsItem( @@ -25500,21 +25215,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_radar_value_list_item> | Res > > { const url = this.basePath + `/v1/radar/value_list_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -25526,22 +25242,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_radar_value_list_item> | Res > > { const url = this.basePath + `/v1/radar/value_list_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25565,7 +25282,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25581,9 +25298,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/radar/value_lists` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ alias: p["alias"], contains: p["contains"], @@ -25597,7 +25315,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25625,21 +25343,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/radar/value_lists` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteRadarValueListsValueList( @@ -25648,21 +25363,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_radar_value_list> | Res > > { const url = this.basePath + `/v1/radar/value_lists/${p["valueList"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -25674,20 +25390,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/radar/value_lists/${p["valueList"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25705,21 +25422,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/radar/value_lists/${p["valueList"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getRefunds( @@ -25741,7 +25455,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25757,9 +25471,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ charge: p["charge"], created: p["created"], @@ -25773,7 +25488,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25800,21 +25515,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/refunds` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getRefundsRefund( @@ -25824,20 +25536,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -25855,21 +25568,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/refunds/${p["refund"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postRefundsRefundCancel( @@ -25880,21 +25590,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/refunds/${p["refund"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getReportingReportRuns( @@ -25914,7 +25621,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -25930,9 +25637,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/reporting/report_runs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -25944,7 +25652,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26602,23 +26310,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reporting_report_run> | Res > > { const url = this.basePath + `/v1/reporting/report_runs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getReportingReportRunsReportRun( @@ -26628,22 +26333,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reporting_report_run> | Res > > { const url = this.basePath + `/v1/reporting/report_runs/${p["reportRun"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26654,7 +26360,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -26670,15 +26376,16 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/reporting/report_types` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26690,22 +26397,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_reporting_report_type> | Res > > { const url = this.basePath + `/v1/reporting/report_types/${p["reportType"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26727,7 +26435,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -26743,9 +26451,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/reviews` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -26757,7 +26466,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26769,20 +26478,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/reviews/${p["review"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26795,21 +26505,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/reviews/${p["review"]}/approve` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSetupAttempts( @@ -26830,7 +26537,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -26846,9 +26553,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/setup_attempts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -26861,7 +26569,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -26886,7 +26594,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -26902,9 +26610,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/setup_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ attach_to_self: p["attachToSelf"], created: p["created"], @@ -26919,7 +26628,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -27284,21 +26993,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/setup_intents` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSetupIntentsIntent( @@ -27309,14 +27015,15 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/setup_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ client_secret: p["clientSecret"], expand: p["expand"], @@ -27325,7 +27032,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -27666,21 +27373,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/setup_intents/${p["intent"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postSetupIntentsIntentCancel( @@ -27695,21 +27399,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/setup_intents/${p["intent"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postSetupIntentsIntentConfirm( @@ -28063,21 +27764,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/setup_intents/${p["intent"]}/confirm` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postSetupIntentsIntentVerifyMicrodeposits( @@ -28091,22 +27789,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/setup_intents/${p["intent"]}/verify_microdeposits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getShippingRates( @@ -28128,7 +27823,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -28144,9 +27839,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/shipping_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -28160,7 +27856,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28201,21 +27897,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/shipping_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getShippingRatesShippingRateToken( @@ -28225,20 +27918,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/shipping_rates/${p["shippingRateToken"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28268,21 +27962,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/shipping_rates/${p["shippingRateToken"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSigmaScheduledQueryRuns( @@ -28294,7 +27985,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -28310,9 +28001,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/sigma/scheduled_query_runs` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28323,7 +28015,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28335,7 +28027,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_scheduled_query_run> | Res @@ -28343,15 +28035,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/sigma/scheduled_query_runs/${p["scheduledQueryRun"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28437,153 +28130,148 @@ export class ApiClient extends AbstractFetchClient { tracking_number?: string } } - statement_descriptor?: string - token?: string - type?: string - usage?: "reusable" | "single_use" - } - } = {}, - timeout?: number, - opts?: RequestInit, - ): Promise< - TypedFetchResponse | Res> - > { - const url = this.basePath + `/v1/sources` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) - const body = JSON.stringify(p.requestBody) - - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) - } - - async getSourcesSource( - p: { - clientSecret?: string - expand?: string[] - source: string - requestBody?: EmptyObject - }, - timeout?: number, - opts?: RequestInit, - ): Promise< - TypedFetchResponse | Res> - > { - const url = this.basePath + `/v1/sources/${p["source"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) - const query = this._query({ - client_secret: p["clientSecret"], - expand: p["expand"], - }) - const body = JSON.stringify(p.requestBody) - - return this._fetch( - url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, - timeout, - ) - } - - async postSourcesSource( - p: { - source: string - requestBody?: { - amount?: number - expand?: string[] - mandate?: { - acceptance?: { - date?: number - ip?: string - offline?: { - contact_email: string - } - online?: { - date?: number - ip?: string - user_agent?: string - } - status: "accepted" | "pending" | "refused" | "revoked" - type?: "offline" | "online" - user_agent?: string - } - amount?: number | "" - currency?: string - interval?: "one_time" | "scheduled" | "variable" - notification_method?: - | "deprecated_none" - | "email" - | "manual" - | "none" - | "stripe_email" - } - metadata?: - | { - [key: string]: string | undefined - } - | "" - owner?: { - address?: { - city?: string - country?: string - line1?: string - line2?: string - postal_code?: string - state?: string - } - email?: string - name?: string - phone?: string - } - source_order?: { - items?: { - amount?: number - currency?: string - description?: string - parent?: string - quantity?: number - type?: "discount" | "shipping" | "sku" | "tax" - }[] - shipping?: { - address: { - city?: string - country?: string - line1: string - line2?: string - postal_code?: string - state?: string - } - carrier?: string - name?: string - phone?: string - tracking_number?: string - } - } + statement_descriptor?: string + token?: string + type?: string + usage?: "reusable" | "single_use" } + } = {}, + timeout?: number, + opts: RequestInit = {}, + ): Promise< + TypedFetchResponse | Res> + > { + const url = this.basePath + `/v1/sources` + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) + const body = JSON.stringify(p.requestBody) + + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) + } + + async getSourcesSource( + p: { + clientSecret?: string + expand?: string[] + source: string + requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/sources/${p["source"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) + const query = this._query({ + client_secret: p["clientSecret"], + expand: p["expand"], }) const body = JSON.stringify(p.requestBody) return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, + url + query, + { method: "GET", body, ...opts, headers }, timeout, ) } + async postSourcesSource( + p: { + source: string + requestBody?: { + amount?: number + expand?: string[] + mandate?: { + acceptance?: { + date?: number + ip?: string + offline?: { + contact_email: string + } + online?: { + date?: number + ip?: string + user_agent?: string + } + status: "accepted" | "pending" | "refused" | "revoked" + type?: "offline" | "online" + user_agent?: string + } + amount?: number | "" + currency?: string + interval?: "one_time" | "scheduled" | "variable" + notification_method?: + | "deprecated_none" + | "email" + | "manual" + | "none" + | "stripe_email" + } + metadata?: + | { + [key: string]: string | undefined + } + | "" + owner?: { + address?: { + city?: string + country?: string + line1?: string + line2?: string + postal_code?: string + state?: string + } + email?: string + name?: string + phone?: string + } + source_order?: { + items?: { + amount?: number + currency?: string + description?: string + parent?: string + quantity?: number + type?: "discount" | "shipping" | "sku" | "tax" + }[] + shipping?: { + address: { + city?: string + country?: string + line1: string + line2?: string + postal_code?: string + state?: string + } + carrier?: string + name?: string + phone?: string + tracking_number?: string + } + } + } + }, + timeout?: number, + opts: RequestInit = {}, + ): Promise< + TypedFetchResponse | Res> + > { + const url = this.basePath + `/v1/sources/${p["source"]}` + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) + const body = JSON.stringify(p.requestBody) + + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) + } + async getSourcesSourceMandateNotificationsMandateNotification( p: { expand?: string[] @@ -28592,7 +28280,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_source_mandate_notification> | Res @@ -28601,15 +28289,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/sources/${p["source"]}/mandate_notifications/${p["mandateNotification"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28624,7 +28313,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -28640,9 +28329,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/sources/${p["source"]}/source_transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28653,7 +28343,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28666,7 +28356,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_source_transaction> | Res @@ -28675,15 +28365,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/sources/${p["source"]}/source_transactions/${p["sourceTransaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28697,21 +28388,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/sources/${p["source"]}/verify` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSubscriptionItems( @@ -28724,7 +28412,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -28740,9 +28428,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/subscription_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28754,7 +28443,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28803,21 +28492,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscription_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteSubscriptionItemsItem( @@ -28830,21 +28516,22 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_subscription_item> | Res > > { const url = this.basePath + `/v1/subscription_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -28856,20 +28543,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscription_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28921,21 +28609,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscription_items/${p["item"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSubscriptionItemsSubscriptionItemUsageRecordSummaries( @@ -28948,7 +28633,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -28966,9 +28651,10 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/subscription_items/${p["subscriptionItem"]}/usage_record_summaries` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -28979,7 +28665,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -28995,23 +28681,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscription_items/${p["subscriptionItem"]}/usage_records` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSubscriptionSchedules( @@ -29057,7 +28740,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -29073,9 +28756,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/subscription_schedules` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ canceled_at: p["canceledAt"], completed_at: p["completedAt"], @@ -29092,7 +28776,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -29247,23 +28931,20 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_subscription_schedule> | Res > > { const url = this.basePath + `/v1/subscription_schedules` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSubscriptionSchedulesSchedule( @@ -29273,22 +28954,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_subscription_schedule> | Res > > { const url = this.basePath + `/v1/subscription_schedules/${p["schedule"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -29442,23 +29124,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_subscription_schedule> | Res > > { const url = this.basePath + `/v1/subscription_schedules/${p["schedule"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postSubscriptionSchedulesScheduleCancel( @@ -29471,7 +29150,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_subscription_schedule> | Res @@ -29479,16 +29158,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/subscription_schedules/${p["schedule"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postSubscriptionSchedulesScheduleRelease( @@ -29500,7 +29176,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_subscription_schedule> | Res @@ -29508,16 +29184,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/subscription_schedules/${p["schedule"]}/release` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSubscriptions( @@ -29571,7 +29244,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -29587,9 +29260,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ automatic_tax: p["automaticTax"], collection_method: p["collectionMethod"], @@ -29609,7 +29283,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -29859,21 +29533,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscriptions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getSubscriptionsSearch( @@ -29885,7 +29556,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -29903,9 +29574,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/subscriptions/search` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"], limit: p["limit"], @@ -29916,7 +29588,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -29944,20 +29616,21 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -29969,21 +29642,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -30250,22 +29924,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscriptions/${p["subscriptionExposedId"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteSubscriptionsSubscriptionExposedIdDiscount( @@ -30274,20 +29945,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscriptions/${p["subscriptionExposedId"]}/discount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -30303,21 +29975,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/subscriptions/${p["subscription"]}/resume` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTaxCalculations( @@ -30444,21 +30113,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/calculations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTaxCalculationsCalculation( @@ -30468,20 +30134,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/calculations/${p["calculation"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -30496,7 +30163,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -30513,9 +30180,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/tax/calculations/${p["calculation"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30526,7 +30194,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -30541,7 +30209,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -30557,9 +30225,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/tax/registrations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -30571,7 +30240,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -30851,21 +30520,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/registrations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTaxRegistrationsId( @@ -30875,20 +30541,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/registrations/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -30903,21 +30570,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/registrations/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTaxSettings( @@ -30926,20 +30590,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/settings` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -30965,21 +30630,18 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/settings` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTaxTransactionsCreateFromCalculation( @@ -30995,21 +30657,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/transactions/create_from_calculation` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTaxTransactionsCreateReversal( @@ -31040,21 +30699,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/transactions/create_reversal` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTaxTransactionsTransaction( @@ -31064,20 +30720,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax/transactions/${p["transaction"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31092,7 +30749,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -31109,9 +30766,10 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/tax/transactions/${p["transaction"]}/line_items` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31122,7 +30780,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31136,7 +30794,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -31152,9 +30810,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/tax_codes` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31165,7 +30824,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31177,20 +30836,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_codes/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31209,7 +30869,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -31225,9 +30885,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31239,7 +30900,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31331,21 +30992,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_ids` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteTaxIdsId( @@ -31354,19 +31012,20 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -31378,20 +31037,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_ids/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31415,7 +31075,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -31431,9 +31091,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/tax_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ active: p["active"], created: p["created"], @@ -31447,7 +31108,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31483,21 +31144,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_rates` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTaxRatesTaxRate( @@ -31507,20 +31165,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_rates/${p["taxRate"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31557,21 +31216,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/tax_rates/${p["taxRate"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTerminalConfigurations( @@ -31584,7 +31240,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -31600,9 +31256,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31614,7 +31271,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31719,23 +31376,20 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_terminal_configuration> | Res > > { const url = this.basePath + `/v1/terminal/configurations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteTerminalConfigurationsConfiguration( @@ -31744,7 +31398,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_terminal_configuration> | Res @@ -31752,14 +31406,15 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/terminal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -31771,7 +31426,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_terminal_configuration | t_deleted_terminal_configuration> @@ -31780,15 +31435,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/terminal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -31902,7 +31558,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_terminal_configuration | t_deleted_terminal_configuration> @@ -31911,16 +31567,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/terminal/configurations/${p["configuration"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTerminalConnectionTokens( @@ -31931,23 +31584,20 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_terminal_connection_token> | Res > > { const url = this.basePath + `/v1/terminal/connection_tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTerminalLocations( @@ -31959,7 +31609,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -31975,9 +31625,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/locations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -31988,7 +31639,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -32015,21 +31666,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/locations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteTerminalLocationsLocation( @@ -32038,21 +31686,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_terminal_location> | Res > > { const url = this.basePath + `/v1/terminal/locations/${p["location"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -32064,7 +31713,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_terminal_location | t_deleted_terminal_location> @@ -32072,15 +31721,16 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/locations/${p["location"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -32108,7 +31758,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_terminal_location | t_deleted_terminal_location> @@ -32116,16 +31766,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/locations/${p["location"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTerminalReaders( @@ -32149,7 +31796,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -32165,9 +31812,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/readers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ device_type: p["deviceType"], ending_before: p["endingBefore"], @@ -32182,7 +31830,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -32202,21 +31850,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/readers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteTerminalReadersReader( @@ -32225,21 +31870,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_terminal_reader> | Res > > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -32251,7 +31897,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_terminal_reader | t_deleted_terminal_reader> @@ -32259,15 +31905,16 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -32286,7 +31933,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res<200, t_terminal_reader | t_deleted_terminal_reader> @@ -32294,16 +31941,13 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTerminalReadersReaderCancelAction( @@ -32314,22 +31958,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}/cancel_action` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTerminalReadersReaderProcessPaymentIntent( @@ -32348,23 +31989,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}/process_payment_intent` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTerminalReadersReaderProcessSetupIntent( @@ -32380,22 +32018,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}/process_setup_intent` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTerminalReadersReaderRefundPayment( @@ -32417,22 +32052,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}/refund_payment` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTerminalReadersReaderSetReaderDisplay( @@ -32454,22 +32086,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/terminal/readers/${p["reader"]}/set_reader_display` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersConfirmationTokens( @@ -32720,23 +32349,20 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_confirmation_token> | Res > > { const url = this.basePath + `/v1/test_helpers/confirmation_tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersCustomersCustomerFundCashBalance( @@ -32750,7 +32376,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_customer_cash_balance_transaction> | Res @@ -32759,16 +32385,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/customers/${p["customer"]}/fund_cash_balance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingAuthorizations( @@ -33170,23 +32793,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res > > { const url = this.basePath + `/v1/test_helpers/issuing/authorizations` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingAuthorizationsAuthorizationCapture( @@ -33275,7 +32895,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -33284,16 +32904,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingAuthorizationsAuthorizationExpire( @@ -33304,7 +32921,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -33313,16 +32930,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/expire` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingAuthorizationsAuthorizationFinalizeAmount( @@ -33383,7 +32997,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -33392,16 +33006,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/finalize_amount` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingAuthorizationsAuthorizationIncrement( @@ -33414,7 +33025,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -33423,16 +33034,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/increment` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingAuthorizationsAuthorizationReverse( @@ -33444,7 +33052,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_authorization> | Res @@ -33453,16 +33061,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/authorizations/${p["authorization"]}/reverse` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingCardsCardShippingDeliver( @@ -33473,23 +33078,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/deliver` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingCardsCardShippingFail( @@ -33500,23 +33102,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingCardsCardShippingReturn( @@ -33527,23 +33126,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingCardsCardShippingShip( @@ -33554,23 +33150,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/test_helpers/issuing/cards/${p["card"]}/shipping/ship` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingPersonalizationDesignsPersonalizationDesignActivate( @@ -33581,7 +33174,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_personalization_design> | Res @@ -33590,16 +33183,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/personalization_designs/${p["personalizationDesign"]}/activate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingPersonalizationDesignsPersonalizationDesignDeactivate( @@ -33610,7 +33200,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_personalization_design> | Res @@ -33619,16 +33209,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/personalization_designs/${p["personalizationDesign"]}/deactivate` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingPersonalizationDesignsPersonalizationDesignReject( @@ -33660,7 +33247,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_personalization_design> | Res @@ -33669,16 +33256,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/personalization_designs/${p["personalizationDesign"]}/reject` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingSettlements( @@ -33696,23 +33280,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_settlement> | Res > > { const url = this.basePath + `/v1/test_helpers/issuing/settlements` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingTransactionsCreateForceCapture( @@ -34106,7 +33687,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_transaction> | Res @@ -34115,16 +33696,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/transactions/create_force_capture` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingTransactionsCreateUnlinkedRefund( @@ -34518,7 +34096,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_transaction> | Res @@ -34527,16 +34105,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/transactions/create_unlinked_refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersIssuingTransactionsTransactionRefund( @@ -34548,7 +34123,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_issuing_transaction> | Res @@ -34557,16 +34132,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/issuing/transactions/${p["transaction"]}/refund` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersRefundsRefundExpire( @@ -34577,21 +34149,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/test_helpers/refunds/${p["refund"]}/expire` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTerminalReadersReaderPresentPaymentMethod( @@ -34610,23 +34179,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/test_helpers/terminal/readers/${p["reader"]}/present_payment_method` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTestHelpersTestClocks( @@ -34638,7 +34204,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -34654,9 +34220,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/test_helpers/test_clocks` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -34667,7 +34234,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -34681,23 +34248,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_test_helpers_test_clock> | Res > > { const url = this.basePath + `/v1/test_helpers/test_clocks` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteTestHelpersTestClocksTestClock( @@ -34706,21 +34270,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_test_helpers_test_clock> | Res > > { const url = this.basePath + `/v1/test_helpers/test_clocks/${p["testClock"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -34732,22 +34297,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_test_helpers_test_clock> | Res > > { const url = this.basePath + `/v1/test_helpers/test_clocks/${p["testClock"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -34761,7 +34327,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_test_helpers_test_clock> | Res @@ -34769,16 +34335,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/test_helpers/test_clocks/${p["testClock"]}/advance` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryInboundTransfersIdFail( @@ -34805,7 +34368,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_inbound_transfer> | Res @@ -34814,16 +34377,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/inbound_transfers/${p["id"]}/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryInboundTransfersIdReturn( @@ -34834,7 +34394,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_inbound_transfer> | Res @@ -34843,16 +34403,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/inbound_transfers/${p["id"]}/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryInboundTransfersIdSucceed( @@ -34863,7 +34420,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_inbound_transfer> | Res @@ -34872,16 +34429,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/inbound_transfers/${p["id"]}/succeed` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundPaymentsId( @@ -34903,7 +34457,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res @@ -34911,16 +34465,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/test_helpers/treasury/outbound_payments/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundPaymentsIdFail( @@ -34931,7 +34482,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res @@ -34940,16 +34491,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_payments/${p["id"]}/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundPaymentsIdPost( @@ -34960,7 +34508,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res @@ -34969,16 +34517,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_payments/${p["id"]}/post` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundPaymentsIdReturn( @@ -35002,7 +34547,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res @@ -35011,16 +34556,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_payments/${p["id"]}/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundTransfersOutboundTransfer( @@ -35042,7 +34584,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res @@ -35051,16 +34593,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundTransfersOutboundTransferFail( @@ -35071,7 +34610,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res @@ -35080,16 +34619,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}/fail` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundTransfersOutboundTransferPost( @@ -35100,7 +34636,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res @@ -35109,16 +34645,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}/post` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryOutboundTransfersOutboundTransferReturn( @@ -35142,7 +34675,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res @@ -35151,16 +34684,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/test_helpers/treasury/outbound_transfers/${p["outboundTransfer"]}/return` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryReceivedCredits( @@ -35183,23 +34713,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_received_credit> | Res > > { const url = this.basePath + `/v1/test_helpers/treasury/received_credits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTestHelpersTreasuryReceivedDebits( @@ -35222,23 +34749,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_received_debit> | Res > > { const url = this.basePath + `/v1/test_helpers/treasury/received_debits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTokens( @@ -35551,19 +35075,16 @@ export class ApiClient extends AbstractFetchClient { } } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/tokens` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTokensToken( @@ -35573,18 +35094,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/tokens/${p["token"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -35615,7 +35137,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -35631,9 +35153,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/topups` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ amount: p["amount"], created: p["created"], @@ -35647,7 +35170,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -35670,19 +35193,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/topups` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTopupsTopup( @@ -35692,18 +35212,19 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/topups/${p["topup"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -35722,19 +35243,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/topups/${p["topup"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async postTopupsTopupCancel( @@ -35745,19 +35263,16 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise | Res>> { const url = this.basePath + `/v1/topups/${p["topup"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTransfers( @@ -35779,7 +35294,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -35795,9 +35310,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], destination: p["destination"], @@ -35811,7 +35327,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -35833,21 +35349,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTransfersIdReversals( @@ -35860,7 +35373,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -35876,9 +35389,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/transfers/${p["id"]}/reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -35889,7 +35403,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -35910,21 +35424,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/transfers/${p["id"]}/reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTransfersTransfer( @@ -35934,20 +35445,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/transfers/${p["transfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -35966,21 +35478,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/transfers/${p["transfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTransfersTransferReversalsId( @@ -35991,21 +35500,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/transfers/${p["transfer"]}/reversals/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36024,22 +35534,19 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/transfers/${p["transfer"]}/reversals/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryCreditReversals( @@ -36054,7 +35561,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -36070,9 +35577,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/credit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36086,7 +35594,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36102,23 +35610,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_credit_reversal> | Res > > { const url = this.basePath + `/v1/treasury/credit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryCreditReversalsCreditReversal( @@ -36128,7 +35633,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_credit_reversal> | Res @@ -36136,15 +35641,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/treasury/credit_reversals/${p["creditReversal"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36162,7 +35668,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -36178,9 +35684,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/debit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36195,7 +35702,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36211,23 +35718,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_debit_reversal> | Res > > { const url = this.basePath + `/v1/treasury/debit_reversals` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryDebitReversalsDebitReversal( @@ -36237,7 +35741,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_debit_reversal> | Res @@ -36245,15 +35749,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/treasury/debit_reversals/${p["debitReversal"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36275,7 +35780,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -36291,9 +35796,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/financial_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -36305,7 +35811,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36362,23 +35868,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_financial_account> | Res > > { const url = this.basePath + `/v1/treasury/financial_accounts` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryFinancialAccountsFinancialAccount( @@ -36388,7 +35891,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_financial_account> | Res @@ -36396,15 +35899,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/treasury/financial_accounts/${p["financialAccount"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36461,7 +35965,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_financial_account> | Res @@ -36469,16 +35973,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/treasury/financial_accounts/${p["financialAccount"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryFinancialAccountsFinancialAccountFeatures( @@ -36488,7 +35989,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_financial_account_features> | Res @@ -36497,15 +35998,16 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/treasury/financial_accounts/${p["financialAccount"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36553,7 +36055,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_financial_account_features> | Res @@ -36562,16 +36064,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/treasury/financial_accounts/${p["financialAccount"]}/features` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryInboundTransfers( @@ -36585,7 +36084,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -36601,9 +36100,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/inbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36616,7 +36116,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36637,23 +36137,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_inbound_transfer> | Res > > { const url = this.basePath + `/v1/treasury/inbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryInboundTransfersId( @@ -36663,22 +36160,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_inbound_transfer> | Res > > { const url = this.basePath + `/v1/treasury/inbound_transfers/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36691,7 +36189,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_inbound_transfer> | Res @@ -36700,16 +36198,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/treasury/inbound_transfers/${p["inboundTransfer"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryOutboundPayments( @@ -36732,7 +36227,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -36748,9 +36243,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/outbound_payments` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], customer: p["customer"], @@ -36765,7 +36261,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36827,23 +36323,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res > > { const url = this.basePath + `/v1/treasury/outbound_payments` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryOutboundPaymentsId( @@ -36853,22 +36346,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res > > { const url = this.basePath + `/v1/treasury/outbound_payments/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36881,7 +36375,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_payment> | Res @@ -36889,16 +36383,13 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/treasury/outbound_payments/${p["id"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryOutboundTransfers( @@ -36912,7 +36403,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -36928,9 +36419,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/outbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -36943,7 +36435,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -36971,23 +36463,20 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res > > { const url = this.basePath + `/v1/treasury/outbound_transfers` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryOutboundTransfersOutboundTransfer( @@ -36997,7 +36486,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res @@ -37005,15 +36494,16 @@ export class ApiClient extends AbstractFetchClient { > { const url = this.basePath + `/v1/treasury/outbound_transfers/${p["outboundTransfer"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37026,7 +36516,7 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_outbound_transfer> | Res @@ -37035,16 +36525,13 @@ export class ApiClient extends AbstractFetchClient { const url = this.basePath + `/v1/treasury/outbound_transfers/${p["outboundTransfer"]}/cancel` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async getTreasuryReceivedCredits( @@ -37065,7 +36552,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -37081,9 +36568,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/received_credits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -37097,7 +36585,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37109,22 +36597,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_received_credit> | Res > > { const url = this.basePath + `/v1/treasury/received_credits/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37140,7 +36629,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -37156,9 +36645,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/received_debits` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -37171,7 +36661,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37183,22 +36673,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_received_debit> | Res > > { const url = this.basePath + `/v1/treasury/received_debits/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37231,7 +36722,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -37247,9 +36738,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/transaction_entries` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], effective_at: p["effectiveAt"], @@ -37265,7 +36757,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37277,22 +36769,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_transaction_entry> | Res > > { const url = this.basePath + `/v1/treasury/transaction_entries/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37327,7 +36820,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -37343,9 +36836,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/treasury/transactions` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ created: p["created"], ending_before: p["endingBefore"], @@ -37361,7 +36855,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37373,22 +36867,23 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_treasury_transaction> | Res > > { const url = this.basePath + `/v1/treasury/transactions/${p["id"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37402,7 +36897,7 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -37418,9 +36913,10 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/v1/webhook_endpoints` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ ending_before: p["endingBefore"], expand: p["expand"], @@ -37431,7 +36927,7 @@ export class ApiClient extends AbstractFetchClient { return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -37794,21 +37290,18 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/webhook_endpoints` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } async deleteWebhookEndpointsWebhookEndpoint( @@ -37817,21 +37310,22 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_deleted_webhook_endpoint> | Res > > { const url = this.basePath + `/v1/webhook_endpoints/${p["webhookEndpoint"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) return this._fetch( url, - { method: "DELETE", headers, body, ...(opts ?? {}) }, + { method: "DELETE", body, ...opts, headers }, timeout, ) } @@ -37843,20 +37337,21 @@ export class ApiClient extends AbstractFetchClient { requestBody?: EmptyObject }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/webhook_endpoints/${p["webhookEndpoint"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const query = this._query({ expand: p["expand"] }) const body = JSON.stringify(p.requestBody) return this._fetch( url + query, - { method: "GET", headers, body, ...(opts ?? {}) }, + { method: "GET", body, ...opts, headers }, timeout, ) } @@ -38117,20 +37612,17 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse | Res> > { const url = this.basePath + `/v1/webhook_endpoints/${p["webhookEndpoint"]}` - const headers = this._headers({ - "Content-Type": "application/x-www-form-urlencoded", - }) + const headers = this._headers( + { "Content-Type": "application/x-www-form-urlencoded" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } } diff --git a/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/client.ts b/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/client.ts index 6b64a8e3..5680a4fa 100644 --- a/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/client.ts +++ b/integration-tests/typescript-fetch/src/generated/todo-lists.yaml/client.ts @@ -32,16 +32,21 @@ export class ApiClient extends AbstractFetchClient { tags?: string[] } = {}, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/list` + const headers = this._headers({}, opts.headers) const query = this._query({ created: p["created"], statuses: p["statuses"], tags: p["tags"], }) - return this._fetch(url + query, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch( + url + query, + { method: "GET", ...opts, headers }, + timeout, + ) } async getTodoListById( @@ -49,15 +54,16 @@ export class ApiClient extends AbstractFetchClient { listId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_TodoList> | Res | Res > > { const url = this.basePath + `/list/${p["listId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async updateTodoListById( @@ -66,21 +72,20 @@ export class ApiClient extends AbstractFetchClient { requestBody: t_CreateUpdateTodoList }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<200, t_TodoList> | Res | Res > > { const url = this.basePath + `/list/${p["listId"]}` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "PUT", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "PUT", body, ...opts, headers }, timeout) } async deleteTodoListById( @@ -88,15 +93,16 @@ export class ApiClient extends AbstractFetchClient { listId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< Res<204, void> | Res | Res > > { const url = this.basePath + `/list/${p["listId"]}` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "DELETE", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "DELETE", ...opts, headers }, timeout) } async getTodoListItems( @@ -104,7 +110,7 @@ export class ApiClient extends AbstractFetchClient { listId: string }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise< TypedFetchResponse< | Res< @@ -126,8 +132,9 @@ export class ApiClient extends AbstractFetchClient { > > { const url = this.basePath + `/list/${p["listId"]}/items` + const headers = this._headers({}, opts.headers) - return this._fetch(url, { method: "GET", ...(opts ?? {}) }, timeout) + return this._fetch(url, { method: "GET", ...opts, headers }, timeout) } async createTodoListItem( @@ -140,16 +147,15 @@ export class ApiClient extends AbstractFetchClient { } }, timeout?: number, - opts?: RequestInit, + opts: RequestInit = {}, ): Promise>> { const url = this.basePath + `/list/${p["listId"]}/items` - const headers = this._headers({ "Content-Type": "application/json" }) + const headers = this._headers( + { "Content-Type": "application/json" }, + opts.headers, + ) const body = JSON.stringify(p.requestBody) - return this._fetch( - url, - { method: "POST", headers, body, ...(opts ?? {}) }, - timeout, - ) + return this._fetch(url, { method: "POST", body, ...opts, headers }, timeout) } } diff --git a/packages/openapi-code-generator/src/typescript/typescript-axios/typescript-axios-client-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-axios/typescript-axios-client-builder.ts index c34c77e5..ba412956 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-axios/typescript-axios-client-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-axios/typescript-axios-client-builder.ts @@ -49,12 +49,12 @@ export class TypescriptAxiosClientBuilder extends TypescriptClientBuilder { const axiosFragment = `this._request({${[ `url: url ${queryString ? "+ query" : ""}`, `method: "${method}"`, - headers ? "headers" : "", requestBodyParameter ? "data: body" : "", // ensure compatibility with `exactOptionalPropertyTypes` compiler option // https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes "...(timeout ? {timeout} : {})", - "...(opts ?? {})", + "...opts", + "headers", ] .filter(Boolean) .join(",\n")}})` @@ -62,7 +62,9 @@ export class TypescriptAxiosClientBuilder extends TypescriptClientBuilder { const body = ` const url = \`${routeToTemplateString(route)}\` ${[ - headers ? `const headers = this._headers(${headers})` : "", + headers + ? `const headers = this._headers(${headers}, opts.headers)` + : "const headers = this._headers({}, opts.headers)", queryString ? `const query = this._query({ ${queryString} })` : "", requestBodyParameter ? "const body = JSON.stringify(p.requestBody)" : "", ] @@ -86,7 +88,12 @@ export class TypescriptAxiosClientBuilder extends TypescriptClientBuilder { parameters: [ operationParameter, {name: "timeout", type: "number", required: false}, - {name: "opts", type: "AxiosRequestConfig", required: false}, + { + name: "opts", + type: "AxiosRequestConfig", + required: true, + default: "{}", + }, ], returnType: `${returnType}`, body, diff --git a/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts index 13c6aff0..2977a4b0 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts @@ -57,9 +57,9 @@ export class TypescriptFetchClientBuilder extends TypescriptClientBuilder { const fetchFragment = `this._fetch(url ${queryString ? "+ query" : ""}, {${[ `method: "${method}",`, - headers ? "headers," : "", requestBodyParameter ? "body," : "", - "...(opts ?? {})", + "...opts,", + "headers", ] .filter(Boolean) .join("\n")}}, timeout)` @@ -67,7 +67,9 @@ export class TypescriptFetchClientBuilder extends TypescriptClientBuilder { const body = ` const url = this.basePath + \`${routeToTemplateString(route)}\` ${[ - headers ? `const headers = this._headers(${headers})` : "", + headers + ? `const headers = this._headers(${headers}, opts.headers)` + : "const headers = this._headers({}, opts.headers)", queryString ? `const query = this._query({ ${queryString} })` : "", requestBodyParameter ? "const body = JSON.stringify(p.requestBody)" : "", ] @@ -93,7 +95,8 @@ export class TypescriptFetchClientBuilder extends TypescriptClientBuilder { { name: "opts", type: "RequestInit", - required: false, + required: true, + default: "{}", }, ], returnType: `TypedFetchResponse<${returnType}>`, diff --git a/packages/typescript-axios-runtime/src/main.spec.ts b/packages/typescript-axios-runtime/src/main.spec.ts index d7106b7f..afe7bbf7 100644 --- a/packages/typescript-axios-runtime/src/main.spec.ts +++ b/packages/typescript-axios-runtime/src/main.spec.ts @@ -1,20 +1,34 @@ -import {describe, expect} from "@jest/globals" -import {AbstractAxiosClient, type QueryParams} from "./main" +import {describe, expect, it} from "@jest/globals" +import type {AxiosRequestConfig, RawAxiosRequestHeaders} from "axios" +import { + AbstractAxiosClient, + type AbstractAxiosConfig, + type HeaderParams, + type QueryParams, +} from "./main" class ConcreteAxiosClient extends AbstractAxiosClient { - constructor() { - super({basePath: "", defaultHeaders: {}}) + // biome-ignore lint/complexity/noUselessConstructor: + constructor(config: AbstractAxiosConfig) { + super(config) } query(params: QueryParams) { return this._query(params) } -} -describe("main", () => { - const client = new ConcreteAxiosClient() + headers( + paramHeaders: HeaderParams = {}, + optsHeaders: AxiosRequestConfig["headers"] = {}, + ): RawAxiosRequestHeaders { + return this._headers(paramHeaders, optsHeaders) + } +} +describe("typescript-axios-runtime/main", () => { describe("_query", () => { + const client = new ConcreteAxiosClient({basePath: "", defaultHeaders: {}}) + it("returns an empty string when all params are undefined", () => { expect(client.query({foo: undefined, bar: undefined})).toBe("") }) @@ -55,4 +69,148 @@ describe("main", () => { ) }) }) + + describe("_headers", () => { + function getActual({ + defaultHeaders, + routeHeaders, + configHeaders, + }: { + defaultHeaders?: Record + routeHeaders?: HeaderParams + configHeaders?: AxiosRequestConfig["headers"] + }) { + const client = new ConcreteAxiosClient({ + basePath: "", + defaultHeaders: defaultHeaders ?? {}, + }) + return client.headers(routeHeaders, configHeaders) + } + + describe("default headers", () => { + it("can set default headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + }) + + expect(actual).toMatchObject({ + authorization: "Bearer: default", + }) + }) + + it("can override default headers with route headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: "Bearer: route"}, + }) + + expect(actual).toMatchObject({authorization: "Bearer: route"}) + }) + + it("can override default headers with config headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: "Bearer: route"}, + configHeaders: {Authorization: "Bearer: config"}, + }) + + expect(actual).toMatchObject({authorization: "Bearer: config"}) + }) + + it("can clear default headers with route headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: null}, + }) + + expect(actual.Authorization).toStrictEqual(undefined) + }) + + it("can clear default headers with config headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: "Bearer: route"}, + // biome-ignore lint/suspicious/noExplicitAny: + configHeaders: {Authorization: null as any}, + }) + + expect(actual.Authorization).toStrictEqual(undefined) + }) + }) + + describe("route headers", () => { + it("applies number route headers", () => { + const actual = getActual({ + routeHeaders: {"X-Rate-Limit": 10}, + }) + + expect(actual["x-rate-limit"]).toStrictEqual("10") + }) + + it("ignores undefined values and lets the default apply", () => { + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + }) + + expect(actual["x-rate-limit"]).toStrictEqual("10") + }) + + it("applies tuple array headers", () => { + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: [ + ["X-Rate-Limit", 20], + ["Foo", "bar"], + ], + }) + + // biome-ignore lint/complexity/useLiteralKeys: + expect(actual["foo"]).toStrictEqual("bar") + expect(actual["x-rate-limit"]).toStrictEqual("20") + }) + + it("applies Headers", () => { + const headers = new Headers() + headers.append("X-Rate-Limit", "20") + headers.append("Foo", "bar") + headers.append("Foo", "foobar") + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: headers, + }) + + // Headers that aren't Set-Cookie get concatenated by the Headers built-in. + // biome-ignore lint/complexity/useLiteralKeys: + expect(actual["foo"]).toStrictEqual("bar, foobar") + expect(actual["x-rate-limit"]).toStrictEqual("20") + }) + }) + + describe("config headers", () => { + it("can receive a Record correctly", () => { + const headers = { + "Set-Cookie": [ + "one=cookie-1; SameSite=None; Secure", + "two=cookie-2; SameSite=None; Secure", + ], + Foo: "bar", + } + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + configHeaders: headers, + }) + + // biome-ignore lint/complexity/useLiteralKeys: + expect(actual["foo"]).toStrictEqual("bar") + expect(actual["set-cookie"]).toStrictEqual( + "one=cookie-1; SameSite=None; Secure,two=cookie-2; SameSite=None; Secure", + ) + expect(actual["x-rate-limit"]).toStrictEqual("10") + }) + }) + }) }) diff --git a/packages/typescript-axios-runtime/src/main.ts b/packages/typescript-axios-runtime/src/main.ts index f062f4ad..574e0284 100644 --- a/packages/typescript-axios-runtime/src/main.ts +++ b/packages/typescript-axios-runtime/src/main.ts @@ -1,4 +1,9 @@ -import axios, {type AxiosInstance, type AxiosRequestConfig} from "axios" +import axios, { + AxiosHeaders, + type AxiosInstance, + type AxiosRequestConfig, + type RawAxiosRequestHeaders, +} from "axios" import qs from "qs" // from https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range @@ -36,6 +41,7 @@ export type QueryParams = { [name: string]: | string | number + | number[] | boolean | string[] | undefined @@ -44,7 +50,10 @@ export type QueryParams = { | QueryParams[] } -export type HeaderParams = Record +export type HeaderParams = + | Record + | [string, string | number | undefined | null][] + | Headers export interface AbstractAxiosConfig { axios?: AxiosInstance @@ -67,7 +76,7 @@ export abstract class AbstractAxiosClient { } protected _request(opts: AxiosRequestConfig) { - const headers = opts.headers ?? this._headers({}) + const headers = opts.headers ?? this._headers() return this.axios.request({ baseURL: this.basePath, @@ -90,11 +99,77 @@ export abstract class AbstractAxiosClient { })}` } - protected _headers(headers: HeaderParams): Record { - return Object.fromEntries( - Object.entries({...this.defaultHeaders, ...headers}).filter( - (it): it is [string, string] => it[1] !== undefined, - ), - ) + /** + * Combines headers for a request, with precedence + * 1. default headers + * 2. route level header parameters + * 3. raw request config (escape hatch) + * + * following these rules: + * - header values of `undefined` are skipped + * - header values of `null` will remove/delete any previously set headers + * + * Eg: + * Passing `Authorization: null` as a parameter, will clear out any + * default `Authorization` header. + * + * But passing `Authorization: undefined` as parameter will fallthrough + * to the default `Authorization` header. + * + * @param paramHeaders + * @param optsHeaders + * @protected + */ + protected _headers( + paramHeaders: HeaderParams = {}, + optsHeaders: AxiosRequestConfig["headers"] = {}, + ): RawAxiosRequestHeaders { + const headers = new AxiosHeaders() + + // axios doesn't know how to append headers, so we just apply + // from the lowest priority to highest. + + this.setHeaders(headers, this.defaultHeaders) + this.setHeaders(headers, paramHeaders) + this.setHeaders(headers, optsHeaders) + + return headers + } + + private setHeaders( + headers: Pick, + headersInit: HeaderParams | AxiosRequestConfig["headers"], + ) { + const headersArray = this.headersAsArray(headersInit) + + for (const [headerName, headerValue] of headersArray) { + if (headerValue === null) { + headers.delete(headerName) + } else if (headerValue !== undefined) { + headers.set(headerName.toLowerCase(), headerValue.toString()) + } + } + } + + private headersAsArray( + headers: HeaderParams | AxiosRequestConfig["headers"], + ): [string, string | number | undefined | null][] { + if (Array.isArray(headers)) { + return headers + } + + if (headers instanceof Headers) { + const result: [string, string][] = [] + headers.forEach((value, key) => { + result.push([key, value]) + }) + return result + } + + if (headers && typeof headers === "object") { + return Object.entries(headers) + } + + return [] } } diff --git a/packages/typescript-fetch-runtime/src/main.spec.ts b/packages/typescript-fetch-runtime/src/main.spec.ts index e2008bff..c991db3f 100644 --- a/packages/typescript-fetch-runtime/src/main.spec.ts +++ b/packages/typescript-fetch-runtime/src/main.spec.ts @@ -1,20 +1,37 @@ -import {describe, expect} from "@jest/globals" -import {AbstractFetchClient, type QueryParams} from "./main" +import {describe, expect, it} from "@jest/globals" +import { + AbstractFetchClient, + type AbstractFetchClientConfig, + type HeaderParams, + type HeadersInit, + type QueryParams, +} from "./main" class ConcreteFetchClient extends AbstractFetchClient { - constructor() { - super({basePath: "", defaultHeaders: {}}) + // biome-ignore lint/complexity/noUselessConstructor: + constructor(config: AbstractFetchClientConfig) { + super(config) } query(params: QueryParams) { return this._query(params) } -} -describe("main", () => { - const client = new ConcreteFetchClient() + headers( + paramHeaders: HeaderParams = {}, + optsHeaders: HeadersInit = {}, + ): Headers { + return this._headers(paramHeaders, optsHeaders) + } +} +describe("typescript-fetch-runtime/main", () => { describe("_query", () => { + const client = new ConcreteFetchClient({ + basePath: "http://localhost:8080", + defaultHeaders: {Authorization: "Bearer: default"}, + }) + it("returns an empty string when all params are undefined", () => { expect(client.query({foo: undefined, bar: undefined})).toBe("") }) @@ -55,4 +72,217 @@ describe("main", () => { ) }) }) + + describe("_headers", () => { + function getActual({ + defaultHeaders, + routeHeaders, + configHeaders, + }: { + defaultHeaders?: Record + routeHeaders?: HeaderParams + configHeaders?: HeadersInit + }) { + const client = new ConcreteFetchClient({ + basePath: "", + defaultHeaders: defaultHeaders ?? {}, + }) + return client.headers(routeHeaders, configHeaders) + } + + describe("default headers", () => { + it("can set default headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["authorization", "Bearer: default"], + ]) + }) + + it("can override default headers with route headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: "Bearer: route"}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["authorization", "Bearer: route"], + ]) + }) + + it("can override default headers with config headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + configHeaders: {Authorization: "Bearer: config"}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["authorization", "Bearer: config"], + ]) + }) + + it("can clear default headers with route headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: null}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([]) + }) + + it("can clear default headers with config headers", () => { + const actual = getActual({ + defaultHeaders: {Authorization: "Bearer: default"}, + routeHeaders: {Authorization: "Bearer: route"}, + // biome-ignore lint/suspicious/noExplicitAny: + configHeaders: {Authorization: null as any}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([]) + }) + }) + + describe("route headers", () => { + it("applies number route headers", () => { + const actual = getActual({ + routeHeaders: {"X-Rate-Limit": 10}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["x-rate-limit", "10"], + ]) + }) + + it("ignores undefined values and lets the default apply", () => { + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["x-rate-limit", "10"], + ]) + }) + + it("applies tuple array headers", () => { + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: [ + ["X-Rate-Limit", 20], + ["Foo", "bar"], + ], + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["foo", "bar"], + ["x-rate-limit", "20"], + ]) + }) + + it("applies Headers", () => { + const headers = new Headers() + headers.append("X-Rate-Limit", "20") + headers.append("Foo", "bar") + headers.append("Foo", "foobar") + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: headers, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + // Headers that aren't Set-Cookie get concatenated by the Headers built-in. + ["foo", "bar, foobar"], + ["x-rate-limit", "20"], + ]) + }) + }) + + describe("config headers", () => { + it("can receive a Headers object correctly", () => { + const headers = new Headers() + headers.append("Set-Cookie", "one=cookie-1; SameSite=None; Secure") + headers.append("Set-Cookie", "two=cookie-2; SameSite=None; Secure") + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + configHeaders: headers, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["set-cookie", "one=cookie-1; SameSite=None; Secure"], + ["set-cookie", "two=cookie-2; SameSite=None; Secure"], + ["x-rate-limit", "10"], + ]) + }) + + it("can receive a [string, string][] correctly", () => { + const headers = [ + ["Set-Cookie", "one=cookie-1; SameSite=None; Secure"] as const, + ["Set-Cookie", "two=cookie-2; SameSite=None; Secure"] as const, + ] as const + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + configHeaders: headers, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["set-cookie", "one=cookie-1; SameSite=None; Secure"], + ["set-cookie", "two=cookie-2; SameSite=None; Secure"], + ["x-rate-limit", "10"], + ]) + }) + + it("can receive a string[][] correctly", () => { + const headers = [ + [ + "Set-Cookie", + "one=cookie-1; SameSite=None; Secure", + "two=cookie-2; SameSite=None; Secure", + ], + ["Foo", "bar"], + ] + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + configHeaders: headers, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["foo", "bar"], + ["set-cookie", "one=cookie-1; SameSite=None; Secure"], + ["set-cookie", "two=cookie-2; SameSite=None; Secure"], + ["x-rate-limit", "10"], + ]) + }) + it("can receive a Record correctly", () => { + const headers = { + "Set-Cookie": [ + "one=cookie-1; SameSite=None; Secure", + "two=cookie-2; SameSite=None; Secure", + ], + Foo: "bar", + } + + const actual = getActual({ + defaultHeaders: {"X-Rate-Limit": "10"}, + routeHeaders: {"X-Rate-Limit": undefined}, + configHeaders: headers, + }) + + expect(Array.from(actual.entries())).toStrictEqual([ + ["foo", "bar"], + ["set-cookie", "one=cookie-1; SameSite=None; Secure"], + ["set-cookie", "two=cookie-2; SameSite=None; Secure"], + ["x-rate-limit", "10"], + ]) + }) + }) + }) }) diff --git a/packages/typescript-fetch-runtime/src/main.ts b/packages/typescript-fetch-runtime/src/main.ts index e53fcd4e..1638b05c 100644 --- a/packages/typescript-fetch-runtime/src/main.ts +++ b/packages/typescript-fetch-runtime/src/main.ts @@ -54,7 +54,17 @@ export type QueryParams = { | QueryParams[] } -export type HeaderParams = Record +export type HeaderParams = + | Record + | [string, string | number | undefined | null][] + | Headers + +// fetch HeadersInit type +export type HeadersInit = + | string[][] + | readonly (readonly [string, string])[] + | Record> + | Headers export abstract class AbstractFetchClient { protected readonly basePath: string @@ -92,7 +102,7 @@ export abstract class AbstractFetchClient { ) } - const headers = opts.headers ?? this._headers({}) + const headers = opts.headers ?? this._headers() return fetch(url, { ...opts, @@ -123,11 +133,127 @@ export abstract class AbstractFetchClient { })}` } - protected _headers(headers: HeaderParams): Record { - return Object.fromEntries( - Object.entries({...this.defaultHeaders, ...headers}) - .filter((it): it is [string, string | number] => it[1] !== undefined) - .map((it): [string, string] => [it[0], String(it[1])]), + /** + * Combines headers for a request, with precedence + * 1. default headers + * 2. route level header parameters + * 3. raw request config (escape hatch) + * + * following these rules: + * - header values of `undefined` are skipped + * - header values of `null` will remove/delete any previously set headers + * + * Eg: + * Passing `Authorization: null` as a parameter, will clear out any + * default `Authorization` header. + * + * But passing `Authorization: undefined` as parameter will fallthrough + * to the default `Authorization` header. + * + * @param paramHeaders + * @param optsHeaders + * @protected + */ + protected _headers( + paramHeaders: HeaderParams = {}, + optsHeaders: HeadersInit = {}, + ): Headers { + const headers = new Headers() + + /* + This is pretty hideous, but basically we: + - Maintain a set of deleted headers, the nullSet + - Apply headers from most specific, to least + - Delete headers if we encounter a null value and note this in the nullSet + + The primary reason is to enable the use of headers.append to support setting + the same header multiple times (aka `Set-Cookie`), whilst *also* allowing more + specific header sources to override all instances of the less specific source. + */ + + const nullSet = new Set() + + this.setHeaders(headers, optsHeaders, nullSet) + this.setHeaders(headers, paramHeaders, nullSet) + this.setHeaders(headers, this.defaultHeaders, nullSet) + + return headers + } + + private setHeaders( + headers: Headers, + headersInit: HeaderParams | HeadersInit, + nullSet: Set, + ) { + const headersArray = this.headersAsArray(headersInit) + + const filteredHeadersArray = headersArray.filter( + ([headerName, headerValue]) => + !headers.has(headerName) && + headerValue !== undefined && + !nullSet.has(headerName), ) + + for (const [headerName, headerValue] of filteredHeadersArray) { + if (headerValue === null) { + headers.delete(headerName) + nullSet.add(headerName) + } else if (headerValue !== undefined) { + headers.append(headerName, headerValue.toString()) + } + } + } + + private headersAsArray( + headers: HeaderParams | HeadersInit, + ): [string, string | number | undefined | null][] { + if (isMultiDimArray(headers)) { + return headers.flatMap((it) => + isNonEmptyArray(it) ? headerArrayToTuples(it) : [], + ) + } + + if (headers instanceof Headers) { + const result: [string, string][] = [] + headers.forEach((value, key) => { + result.push([key, value]) + }) + return result + } + + if (headers && typeof headers === "object") { + const result: [string, string][] = [] + + for (const [headerName, values] of Object.entries(headers)) { + if (Array.isArray(values)) { + for (const value of values) { + result.push([headerName, value]) + } + } else { + result.push([headerName, values]) + } + } + + return result + } + + throw new Error(`couldn't process headers '${headers}'`) } } + +function isMultiDimArray(arr: unknown): arr is T[][] { + return Array.isArray(arr) && Array.isArray(arr[0]) +} + +type NonEmptyArray = [T, ...T[]] + +function isNonEmptyArray(it: T[]): it is NonEmptyArray { + return Array.isArray(it) && it.length > 0 +} + +function headerArrayToTuples([ + head, + ...rest +]: [string, ...T[]]): [string, T][] { + return rest.map((value) => [head, value] as const) +}