/** * MetadataSchemas service. * @module api/MetadataSchemasApi */ export default class MetadataSchemasApi { /** * Constructs a new MetadataSchemasApi. * @alias MetadataSchemasApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: any); apiClient: any; /** * Callback function to receive the result of the getMetadataSchema operation. * @callback getMetadataSchemaCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {MetadataSchemasGetResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get Metadata Schema * Retrieves a metadata schema per resource type. # Resource types ## Standard You can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter. - campaign - customer - earning_rule - loyalty_tier - order - order_item - product - promotion_tier - publication - redemption - reward - voucher ## Custom If you have defined a [custom metadata schema](/prepare/metadata#add-metadata), provide its name in the resource field to retrieve its details. Management API If you have Management API enabled, you can also use the [Get Metadata Schemas](/api-reference/management/get-metadata-schema) endpoint to retrieve a metadata schema using its ID. * @param {String} resource There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. * @param {getMetadataSchemaCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link MetadataSchemasGetResponseBody} * @returns {Promise<(MetadataSchemasGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `MetadataSchemasGetResponseBody` object or with `undefined`. */ getMetadataSchema(resource: string, callback?: (error: Error | null, data?: MetadataSchemasGetResponseBody, response?: any) => any): Promise<(MetadataSchemasGetResponseBody | undefined)>; /** * Callback function to receive the result of the listMetadataSchemas operation. * @callback listMetadataSchemasCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {MetadataSchemasListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Metadata Schema Definitions * Retrieve metadata schema definitions. Management API If you have Management API enabled, you can also use the [List Metadata Schemas](/api-reference/management/list-metadata-schemas) endpoint to list all metadata schemas. * @param {listMetadataSchemasCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link MetadataSchemasListResponseBody} * @returns {Promise<(MetadataSchemasListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `MetadataSchemasListResponseBody` object or with `undefined`. */ listMetadataSchemas(callback?: (error: Error | null, data?: MetadataSchemasListResponseBody, response?: any) => any): Promise<(MetadataSchemasListResponseBody | undefined)>; } import MetadataSchemasGetResponseBody from '../model/MetadataSchemasGetResponseBody'; import MetadataSchemasListResponseBody from '../model/MetadataSchemasListResponseBody';