cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/access/bookmarks.ts
178lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. |
| 2 | |
| 3 | import * as Core from 'cloudflare/core'; |
| 4 | import { APIResource } from 'cloudflare/resource'; |
| 5 | import * as BookmarksAPI from 'cloudflare/resources/access/bookmarks'; |
| 6 | |
| 7 | export class Bookmarks extends APIResource { |
| 8 | /** |
| 9 | * Fetches a single Bookmark application. |
| 10 | */ |
| 11 | retrieve( |
| 12 | identifier: unknown, |
| 13 | uuid: string, |
| 14 | options?: Core.RequestOptions, |
| 15 | ): Core.APIPromise<BookmarkRetrieveResponse> { |
| 16 | return ( |
| 17 | this._client.get(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{ |
| 18 | result: BookmarkRetrieveResponse; |
| 19 | }> |
| 20 | )._thenUnwrap((obj) => obj.result); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Updates a configured Bookmark application. |
| 25 | */ |
| 26 | update( |
| 27 | identifier: unknown, |
| 28 | uuid: string, |
| 29 | options?: Core.RequestOptions, |
| 30 | ): Core.APIPromise<BookmarkUpdateResponse> { |
| 31 | return ( |
| 32 | this._client.put(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{ |
| 33 | result: BookmarkUpdateResponse; |
| 34 | }> |
| 35 | )._thenUnwrap((obj) => obj.result); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Deletes a Bookmark application. |
| 40 | */ |
| 41 | delete( |
| 42 | identifier: unknown, |
| 43 | uuid: string, |
| 44 | options?: Core.RequestOptions, |
| 45 | ): Core.APIPromise<BookmarkDeleteResponse> { |
| 46 | return ( |
| 47 | this._client.delete(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{ |
| 48 | result: BookmarkDeleteResponse; |
| 49 | }> |
| 50 | )._thenUnwrap((obj) => obj.result); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Lists Bookmark applications. |
| 55 | */ |
| 56 | accessBookmarkApplicationsDeprecatedListBookmarkApplications( |
| 57 | identifier: unknown, |
| 58 | options?: Core.RequestOptions, |
| 59 | ): Core.APIPromise<BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse | null> { |
| 60 | return ( |
| 61 | this._client.get(`/accounts/${identifier}/access/bookmarks`, options) as Core.APIPromise<{ |
| 62 | result: BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse | null; |
| 63 | }> |
| 64 | )._thenUnwrap((obj) => obj.result); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | export interface BookmarkRetrieveResponse { |
| 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 | export interface BookmarkUpdateResponse { |
| 100 | /** |
| 101 | * The unique identifier for the Bookmark application. |
| 102 | */ |
| 103 | id?: unknown; |
| 104 | |
| 105 | /** |
| 106 | * Displays the application in the App Launcher. |
| 107 | */ |
| 108 | app_launcher_visible?: boolean; |
| 109 | |
| 110 | created_at?: string; |
| 111 | |
| 112 | /** |
| 113 | * The domain of the Bookmark application. |
| 114 | */ |
| 115 | domain?: string; |
| 116 | |
| 117 | /** |
| 118 | * The image URL for the logo shown in the App Launcher dashboard. |
| 119 | */ |
| 120 | logo_url?: string; |
| 121 | |
| 122 | /** |
| 123 | * The name of the Bookmark application. |
| 124 | */ |
| 125 | name?: string; |
| 126 | |
| 127 | updated_at?: string; |
| 128 | } |
| 129 | |
| 130 | export interface BookmarkDeleteResponse { |
| 131 | /** |
| 132 | * UUID |
| 133 | */ |
| 134 | id?: string; |
| 135 | } |
| 136 | |
| 137 | export type BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse = |
| 138 | Array<BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse.BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseItem>; |
| 139 | |
| 140 | export namespace BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse { |
| 141 | export interface BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseItem { |
| 142 | /** |
| 143 | * The unique identifier for the Bookmark application. |
| 144 | */ |
| 145 | id?: unknown; |
| 146 | |
| 147 | /** |
| 148 | * Displays the application in the App Launcher. |
| 149 | */ |
| 150 | app_launcher_visible?: boolean; |
| 151 | |
| 152 | created_at?: string; |
| 153 | |
| 154 | /** |
| 155 | * The domain of the Bookmark application. |
| 156 | */ |
| 157 | domain?: string; |
| 158 | |
| 159 | /** |
| 160 | * The image URL for the logo shown in the App Launcher dashboard. |
| 161 | */ |
| 162 | logo_url?: string; |
| 163 | |
| 164 | /** |
| 165 | * The name of the Bookmark application. |
| 166 | */ |
| 167 | name?: string; |
| 168 | |
| 169 | updated_at?: string; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | export namespace Bookmarks { |
| 174 | export import BookmarkRetrieveResponse = BookmarksAPI.BookmarkRetrieveResponse; |
| 175 | export import BookmarkUpdateResponse = BookmarksAPI.BookmarkUpdateResponse; |
| 176 | export import BookmarkDeleteResponse = BookmarksAPI.BookmarkDeleteResponse; |
| 177 | export import BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse = BookmarksAPI.BookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse; |
| 178 | } |