cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7609e84ab3db53e79aefce6a112e90cb2a2bbba0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/access/bookmarks.ts

174lines · modecode

1// File generated from our OpenAPI spec by Stainless.
2
3import * as Core from 'cloudflare/core';
4import { APIResource } from 'cloudflare/resource';
5import * as BookmarksAPI from 'cloudflare/resources/access/bookmarks';
6
7export class Bookmarks extends APIResource {
8 /**
9 * Lists Bookmark applications.
10 */
11 list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise<BookmarkListResponse | null> {
12 return (
13 this._client.get(`/accounts/${identifier}/access/bookmarks`, options) as Core.APIPromise<{
14 result: BookmarkListResponse | null;
15 }>
16 )._thenUnwrap((obj) => obj.result);
17 }
18
19 /**
20 * Deletes a Bookmark application.
21 */
22 delete(
23 identifier: unknown,
24 uuid: string,
25 options?: Core.RequestOptions,
26 ): Core.APIPromise<BookmarkDeleteResponse> {
27 return (
28 this._client.delete(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{
29 result: BookmarkDeleteResponse;
30 }>
31 )._thenUnwrap((obj) => obj.result);
32 }
33
34 /**
35 * Fetches a single Bookmark application.
36 */
37 get(
38 identifier: unknown,
39 uuid: string,
40 options?: Core.RequestOptions,
41 ): Core.APIPromise<BookmarkGetResponse> {
42 return (
43 this._client.get(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{
44 result: BookmarkGetResponse;
45 }>
46 )._thenUnwrap((obj) => obj.result);
47 }
48
49 /**
50 * Updates a configured Bookmark application.
51 */
52 replace(
53 identifier: unknown,
54 uuid: string,
55 options?: Core.RequestOptions,
56 ): Core.APIPromise<BookmarkReplaceResponse> {
57 return (
58 this._client.put(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{
59 result: BookmarkReplaceResponse;
60 }>
61 )._thenUnwrap((obj) => obj.result);
62 }
63}
64
65export type BookmarkListResponse = Array<BookmarkListResponse.BookmarkListResponseItem>;
66
67export namespace BookmarkListResponse {
68 export interface BookmarkListResponseItem {
69 /**
70 * The unique identifier for the Bookmark application.
71 */
72 id?: unknown;
73
74 /**
75 * Displays the application in the App Launcher.
76 */
77 app_launcher_visible?: boolean;
78
79 created_at?: string;
80
81 /**
82 * The domain of the Bookmark application.
83 */
84 domain?: string;
85
86 /**
87 * The image URL for the logo shown in the App Launcher dashboard.
88 */
89 logo_url?: string;
90
91 /**
92 * The name of the Bookmark application.
93 */
94 name?: string;
95
96 updated_at?: string;
97 }
98}
99
100export interface BookmarkDeleteResponse {
101 /**
102 * UUID
103 */
104 id?: string;
105}
106
107export interface BookmarkGetResponse {
108 /**
109 * The unique identifier for the Bookmark application.
110 */
111 id?: unknown;
112
113 /**
114 * Displays the application in the App Launcher.
115 */
116 app_launcher_visible?: boolean;
117
118 created_at?: string;
119
120 /**
121 * The domain of the Bookmark application.
122 */
123 domain?: string;
124
125 /**
126 * The image URL for the logo shown in the App Launcher dashboard.
127 */
128 logo_url?: string;
129
130 /**
131 * The name of the Bookmark application.
132 */
133 name?: string;
134
135 updated_at?: string;
136}
137
138export interface BookmarkReplaceResponse {
139 /**
140 * The unique identifier for the Bookmark application.
141 */
142 id?: unknown;
143
144 /**
145 * Displays the application in the App Launcher.
146 */
147 app_launcher_visible?: boolean;
148
149 created_at?: string;
150
151 /**
152 * The domain of the Bookmark application.
153 */
154 domain?: string;
155
156 /**
157 * The image URL for the logo shown in the App Launcher dashboard.
158 */
159 logo_url?: string;
160
161 /**
162 * The name of the Bookmark application.
163 */
164 name?: string;
165
166 updated_at?: string;
167}
168
169export namespace Bookmarks {
170 export import BookmarkListResponse = BookmarksAPI.BookmarkListResponse;
171 export import BookmarkDeleteResponse = BookmarksAPI.BookmarkDeleteResponse;
172 export import BookmarkGetResponse = BookmarksAPI.BookmarkGetResponse;
173 export import BookmarkReplaceResponse = BookmarksAPI.BookmarkReplaceResponse;
174}