@@ -10,28 +10,56 @@ import { path } from '../internal/utils/path';
1010
1111export class Brands extends APIResource {
1212 /**
13- * Create a new brand
13+ * Create a new brand. Requires `name` and `settings` (with at least
14+ * `colors.primary` and `colors.secondary`).
15+ *
16+ * @example
17+ * ```ts
18+ * const brand = await client.brands.create({
19+ * name: 'My Brand',
20+ * settings: {
21+ * colors: { primary: '#9D3789', secondary: '#FFFFFF' },
22+ * },
23+ * });
24+ * ```
1425 */
1526 create ( body : BrandCreateParams , options ?: RequestOptions ) : APIPromise < Brand > {
1627 return this . _client . post ( '/brands' , { body, ...options } ) ;
1728 }
1829
1930 /**
2031 * Fetch a specific brand by brand ID.
32+ *
33+ * @example
34+ * ```ts
35+ * const brand = await client.brands.retrieve('brand_id');
36+ * ```
2137 */
2238 retrieve ( brandID : string , options ?: RequestOptions ) : APIPromise < Brand > {
2339 return this . _client . get ( path `/brands/${ brandID } ` , options ) ;
2440 }
2541
2642 /**
2743 * Replace an existing brand with the supplied values.
44+ *
45+ * @example
46+ * ```ts
47+ * const brand = await client.brands.update('brand_id', {
48+ * name: 'name',
49+ * });
50+ * ```
2851 */
2952 update ( brandID : string , body : BrandUpdateParams , options ?: RequestOptions ) : APIPromise < Brand > {
3053 return this . _client . put ( path `/brands/${ brandID } ` , { body, ...options } ) ;
3154 }
3255
3356 /**
3457 * Get the list of brands.
58+ *
59+ * @example
60+ * ```ts
61+ * const brands = await client.brands.list();
62+ * ```
3563 */
3664 list (
3765 query : BrandListParams | null | undefined = { } ,
@@ -42,6 +70,11 @@ export class Brands extends APIResource {
4270
4371 /**
4472 * Delete a brand by brand ID.
73+ *
74+ * @example
75+ * ```ts
76+ * await client.brands.delete('brand_id');
77+ * ```
4578 */
4679 delete ( brandID : string , options ?: RequestOptions ) : APIPromise < void > {
4780 return this . _client . delete ( path `/brands/${ brandID } ` , {
@@ -194,9 +227,9 @@ export interface BrandListResponse {
194227export interface BrandCreateParams {
195228 name : string ;
196229
197- id ?: string | null ;
230+ settings : BrandSettings ;
198231
199- settings ?: BrandSettings | null ;
232+ id ?: string | null ;
200233
201234 snippets ?: BrandSnippets | null ;
202235}
0 commit comments