@@ -26,10 +26,7 @@ export class CustomMetadataFields extends APIResource {
2626 * });
2727 * ```
2828 */
29- create (
30- body : CustomMetadataFieldCreateParams ,
31- options ?: RequestOptions ,
32- ) : APIPromise < CustomMetadataFieldCreateResponse > {
29+ create ( body : CustomMetadataFieldCreateParams , options ?: RequestOptions ) : APIPromise < CustomMetadataField > {
3330 return this . _client . post ( '/v1/customMetadataFields' , { body, ...options } ) ;
3431 }
3532
@@ -53,7 +50,7 @@ export class CustomMetadataFields extends APIResource {
5350 id : string ,
5451 body : CustomMetadataFieldUpdateParams | null | undefined = { } ,
5552 options ?: RequestOptions ,
56- ) : APIPromise < CustomMetadataFieldUpdateResponse > {
53+ ) : APIPromise < CustomMetadataField > {
5754 return this . _client . patch ( path `/v1/customMetadataFields/${ id } ` , { body, ...options } ) ;
5855 }
5956
@@ -93,87 +90,7 @@ export class CustomMetadataFields extends APIResource {
9390/**
9491 * Object containing details of a custom metadata field.
9592 */
96- export interface CustomMetadataFieldCreateResponse {
97- /**
98- * Unique identifier for the custom metadata field. Use this to update the field.
99- */
100- id : string ;
101-
102- /**
103- * Human readable name of the custom metadata field. This name is displayed as form
104- * field label to the users while setting field value on the asset in the media
105- * library UI.
106- */
107- label : string ;
108-
109- /**
110- * API name of the custom metadata field. This becomes the key while setting
111- * `customMetadata` (key-value object) for an asset using upload or update API.
112- */
113- name : string ;
114-
115- /**
116- * An object that describes the rules for the custom metadata field value.
117- */
118- schema : CustomMetadataFieldCreateResponse . Schema ;
119- }
120-
121- export namespace CustomMetadataFieldCreateResponse {
122- /**
123- * An object that describes the rules for the custom metadata field value.
124- */
125- export interface Schema {
126- /**
127- * Type of the custom metadata field.
128- */
129- type : 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect' ;
130-
131- /**
132- * The default value for this custom metadata field. Date type of default value
133- * depends on the field type.
134- */
135- defaultValue ?: string | number | boolean | Array < string | number | boolean > ;
136-
137- /**
138- * Specifies if the this custom metadata field is required or not.
139- */
140- isValueRequired ?: boolean ;
141-
142- /**
143- * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
144- */
145- maxLength ?: number ;
146-
147- /**
148- * Maximum value of the field. Only set if field type is `Date` or `Number`. For
149- * `Date` type field, the value will be in ISO8601 string format. For `Number` type
150- * field, it will be a numeric value.
151- */
152- maxValue ?: string | number ;
153-
154- /**
155- * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
156- */
157- minLength ?: number ;
158-
159- /**
160- * Minimum value of the field. Only set if field type is `Date` or `Number`. For
161- * `Date` type field, the value will be in ISO8601 string format. For `Number` type
162- * field, it will be a numeric value.
163- */
164- minValue ?: string | number ;
165-
166- /**
167- * An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
168- */
169- selectOptions ?: Array < string | number | boolean > ;
170- }
171- }
172-
173- /**
174- * Object containing details of a custom metadata field.
175- */
176- export interface CustomMetadataFieldUpdateResponse {
93+ export interface CustomMetadataField {
17794 /**
17895 * Unique identifier for the custom metadata field. Use this to update the field.
17996 */
@@ -195,10 +112,10 @@ export interface CustomMetadataFieldUpdateResponse {
195112 /**
196113 * An object that describes the rules for the custom metadata field value.
197114 */
198- schema : CustomMetadataFieldUpdateResponse . Schema ;
115+ schema : CustomMetadataField . Schema ;
199116}
200117
201- export namespace CustomMetadataFieldUpdateResponse {
118+ export namespace CustomMetadataField {
202119 /**
203120 * An object that describes the rules for the custom metadata field value.
204121 */
@@ -250,90 +167,7 @@ export namespace CustomMetadataFieldUpdateResponse {
250167 }
251168}
252169
253- export type CustomMetadataFieldListResponse =
254- Array < CustomMetadataFieldListResponse . CustomMetadataFieldListResponseItem > ;
255-
256- export namespace CustomMetadataFieldListResponse {
257- /**
258- * Object containing details of a custom metadata field.
259- */
260- export interface CustomMetadataFieldListResponseItem {
261- /**
262- * Unique identifier for the custom metadata field. Use this to update the field.
263- */
264- id : string ;
265-
266- /**
267- * Human readable name of the custom metadata field. This name is displayed as form
268- * field label to the users while setting field value on the asset in the media
269- * library UI.
270- */
271- label : string ;
272-
273- /**
274- * API name of the custom metadata field. This becomes the key while setting
275- * `customMetadata` (key-value object) for an asset using upload or update API.
276- */
277- name : string ;
278-
279- /**
280- * An object that describes the rules for the custom metadata field value.
281- */
282- schema : CustomMetadataFieldListResponseItem . Schema ;
283- }
284-
285- export namespace CustomMetadataFieldListResponseItem {
286- /**
287- * An object that describes the rules for the custom metadata field value.
288- */
289- export interface Schema {
290- /**
291- * Type of the custom metadata field.
292- */
293- type : 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect' ;
294-
295- /**
296- * The default value for this custom metadata field. Date type of default value
297- * depends on the field type.
298- */
299- defaultValue ?: string | number | boolean | Array < string | number | boolean > ;
300-
301- /**
302- * Specifies if the this custom metadata field is required or not.
303- */
304- isValueRequired ?: boolean ;
305-
306- /**
307- * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
308- */
309- maxLength ?: number ;
310-
311- /**
312- * Maximum value of the field. Only set if field type is `Date` or `Number`. For
313- * `Date` type field, the value will be in ISO8601 string format. For `Number` type
314- * field, it will be a numeric value.
315- */
316- maxValue ?: string | number ;
317-
318- /**
319- * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
320- */
321- minLength ?: number ;
322-
323- /**
324- * Minimum value of the field. Only set if field type is `Date` or `Number`. For
325- * `Date` type field, the value will be in ISO8601 string format. For `Number` type
326- * field, it will be a numeric value.
327- */
328- minValue ?: string | number ;
329-
330- /**
331- * An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
332- */
333- selectOptions ?: Array < string | number | boolean > ;
334- }
335- }
336- }
170+ export type CustomMetadataFieldListResponse = Array < CustomMetadataField > ;
337171
338172export interface CustomMetadataFieldDeleteResponse { }
339173
@@ -493,8 +327,7 @@ export interface CustomMetadataFieldListParams {
493327
494328export declare namespace CustomMetadataFields {
495329 export {
496- type CustomMetadataFieldCreateResponse as CustomMetadataFieldCreateResponse ,
497- type CustomMetadataFieldUpdateResponse as CustomMetadataFieldUpdateResponse ,
330+ type CustomMetadataField as CustomMetadataField ,
498331 type CustomMetadataFieldListResponse as CustomMetadataFieldListResponse ,
499332 type CustomMetadataFieldDeleteResponse as CustomMetadataFieldDeleteResponse ,
500333 type CustomMetadataFieldCreateParams as CustomMetadataFieldCreateParams ,
0 commit comments