cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.3.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/ai-gateway/urls.ts

43lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5
6export class URLs extends APIResource {
7 /**
8 * Get Gateway URL
9 *
10 * @example
11 * ```ts
12 * const url = await client.aiGateway.urls.get(
13 * 'my-gateway',
14 * 'workers-ai',
15 * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
16 * );
17 * ```
18 */
19 get(
20 gatewayId: string,
21 provider: string,
22 params: URLGetParams,
23 options?: Core.RequestOptions,
24 ): Core.APIPromise<URLGetResponse> {
25 const { account_id } = params;
26 return (
27 this._client.get(
28 `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/url/${provider}`,
29 options,
30 ) as Core.APIPromise<{ result: URLGetResponse }>
31 )._thenUnwrap((obj) => obj.result);
32 }
33}
34
35export type URLGetResponse = string;
36
37export interface URLGetParams {
38 account_id: string;
39}
40
41export declare namespace URLs {
42 export { type URLGetResponse as URLGetResponse, type URLGetParams as URLGetParams };
43}
44