// tslint:disable /** * Copyright 2022 Splunk, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"): you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * Search Catalog service * With the Metadata Catalog in Splunk Cloud Services you can create and manage knowledge objects such as datasets, fields, rules, actions, and dashboards. * * OpenAPI spec version: v2beta1.4 (recommended default) * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { Action, ActionPATCH, ActionPOST, Annotation, AnnotationPOST, Dashboard, DashboardPATCH, DashboardPOST, Dataset, DatasetGet, DatasetImportedBy, DatasetPATCH, DatasetPOST, Field, FieldPATCH, FieldPOST, Module, Relationship, RelationshipPATCH, RelationshipPOST, Rule, RulePATCH, RulePOST, } from '../models'; import BaseApiService from "../../../../baseapiservice"; import { CatalogServiceExtensions } from "../../../../service_extensions/catalog"; import { SplunkError, RequestStatus } from '../../../../client'; export const CATALOG_SERVICE_PREFIX: string = '/catalog/v2beta1'; export const CATALOG_SERVICE_CLUSTER: string = 'api'; /** * Search Catalog service * Version: v2beta1.4 * With the Metadata Catalog in Splunk Cloud Services you can create and manage knowledge objects such as datasets, fields, rules, actions, and dashboards. */ export class GeneratedCatalogService extends BaseApiService { getServiceCluster() : string { return CATALOG_SERVICE_CLUSTER } getServicePrefix() : string { return CATALOG_SERVICE_PREFIX; } /** * Creates a new action for the specified rule by rule id or resource name. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param actionPOST The JSON representation of the action to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Action */ public createActionForRule = (ruleresource: string, actionPOST: ActionPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}/actions`(path_params); return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), actionPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Action); } /** * Creates a new annotation for the specified dashboard. * @param dashboardresource ID or the resource name of a dashvboard. The resource name format is module.dashboardname. * @param annotationPOST The JSON representation of the annotation to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Annotation */ public createAnnotationForDashboard = (dashboardresource: string, annotationPOST: AnnotationPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { dashboardresource: dashboardresource }; const path = this.template`/catalog/v2beta1/dashboards/${'dashboardresource'}/annotations`(path_params); return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), annotationPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Annotation); } /** * Creates a new annotation for the specified dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param annotationPOST The JSON representation of the annotation to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Annotation */ public createAnnotationForDataset = (datasetresource: string, annotationPOST: AnnotationPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/annotations`(path_params); return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), annotationPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Annotation); } /** * Creates a new dashboard. * @param dashboardPOST The JSON representation of the Dashboard to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dashboard */ public createDashboard = (dashboardPOST: DashboardPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/catalog/v2beta1/dashboards`; return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), dashboardPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Dashboard); } /** * Creates a new dataset. * @param datasetPOST JSON representation of the DatasetInfo to be persisted * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dataset */ public createDataset = (datasetPOST: DatasetPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/catalog/v2beta1/datasets`; return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), datasetPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Dataset); } /** * Creates a new dataset import using the ID or resource name of the imported dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param datasetImportedBy * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return DatasetImportedBy */ public createDatasetImport = (datasetresource: string, datasetImportedBy?: DatasetImportedBy, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { if (!datasetImportedBy) { throw new SplunkError({ message: `Bad Request: datasetImportedBy is empty or undefined` }); } const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/imported-by`(path_params); return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), datasetImportedBy, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as DatasetImportedBy); } /** * Adds a new field to the dataset with the specified ID or resource name. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param fieldPOST The JSON representation of the field to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Field */ public createFieldForDataset = (datasetresource: string, fieldPOST: FieldPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/fields`(path_params); return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), fieldPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Field); } /** * Creates a new relationship. * @param relationshipPOST The JSON representation of the relationship to persist. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Relationship */ public createRelationship = (relationshipPOST: RelationshipPOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/catalog/v2beta1/relationships`; return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), relationshipPOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Relationship); } /** * Creates a new rule. * @param rulePOST The JSON representation of the rule to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Rule */ public createRule = (rulePOST: RulePOST, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/catalog/v2beta1/rules`; return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), rulePOST, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Rule); } /** * Deletes the action with the specified ID that is associated with the specified rule. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param actionid ID of an Action. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteActionByIdForRule = (ruleresource: string, actionid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource, actionid: actionid }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}/actions/${'actionid'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the annotation with the speciifed ID that is associted with the specified dashboard. * @param dashboardresource ID or the resource name of a dashvboard. The resource name format is module.dashboardname. * @param annotationid ID of a annotation. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteAnnotationOfDashboard = (dashboardresource: string, annotationid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { dashboardresource: dashboardresource, annotationid: annotationid }; const path = this.template`/catalog/v2beta1/dashboards/${'dashboardresource'}/annotations/${'annotationid'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the annotation with the specified ID that is associated with the specified dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param annotationid ID of a annotation. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteAnnotationOfDataset = (datasetresource: string, annotationid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource, annotationid: annotationid }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/annotations/${'annotationid'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the dashboard with the specified ID or resource name. * @param dashboardresource ID or the resource name of a dashvboard. The resource name format is module.dashboardname. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteDashboard = (dashboardresource: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { dashboardresource: dashboardresource }; const path = this.template`/catalog/v2beta1/dashboards/${'dashboardresource'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the dataset with the specified ID or resource name. Deleting a dataset also deletes its dependent objects, such as fields. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteDataset = (datasetresource: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the field with the specified ID that is part of the specified dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param fieldid ID of a Field. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteFieldByIdForDataset = (datasetresource: string, fieldid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource, fieldid: fieldid }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/fields/${'fieldid'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the relationship with the specified relationship ID. Deleting a relationship also deletes any objects that are dependents of that relationship, such as relationship fields. * @param relationshipid ID of a relationship. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteRelationshipById = (relationshipid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { relationshipid: relationshipid }; const path = this.template`/catalog/v2beta1/relationships/${'relationshipid'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Deletes the rule with the specfied ID or resource name. Deleting a rule also deleletes any objects that are dependents of that rule, such as rule actions. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteRule = (ruleresource: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}`(path_params); return this.client.delete(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Returns information about the action with the specified ID that is associated with the specified rule. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param actionid ID of an Action. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Action */ public getActionByIdForRule = (ruleresource: string, actionid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource, actionid: actionid }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}/actions/${'actionid'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Action); } /** * Returns information about the dashboard with the specified ID or resource name. * @param dashboardresource ID or the resource name of a dashvboard. The resource name format is module.dashboardname. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dashboard */ public getDashboard = (dashboardresource: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { dashboardresource: dashboardresource }; const path = this.template`/catalog/v2beta1/dashboards/${'dashboardresource'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Dashboard); } /** * Returns information about the dataset with the specified ID or resource name. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param args parameters to be sent with the request * @param args.maxstale The number of seconds beyond which we will refresh index metadata. * @param requestStatusCallback callback function to listen to the status of a request * @return DatasetGet */ public getDataset = (datasetresource: string, args?: { maxstale?: number, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as DatasetGet); } /** * Returns the field with the specified ID. * @param fieldid ID of a Field. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Field */ public getFieldById = (fieldid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { fieldid: fieldid }; const path = this.template`/catalog/v2beta1/fields/${'fieldid'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Field); } /** * Returns the field with the specified ID that is part of the specified dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param fieldid ID of a Field. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Field */ public getFieldByIdForDataset = (datasetresource: string, fieldid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource, fieldid: fieldid }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/fields/${'fieldid'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Field); } /** * Returns the relationship with the specified relationship ID. * @param relationshipid ID of a relationship. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Relationship */ public getRelationshipById = (relationshipid: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { relationshipid: relationshipid }; const path = this.template`/catalog/v2beta1/relationships/${'relationshipid'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Relationship); } /** * Returns information about rule with the specified rule ID or resource name. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Rule */ public getRule = (ruleresource: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Rule); } /** * Creates a new dataset import using the ID or resource name of the imported dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param datasetImportedBy * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return DatasetImportedBy */ public importDataset = (datasetresource: string, datasetImportedBy?: DatasetImportedBy, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { if (!datasetImportedBy) { throw new SplunkError({ message: `Bad Request: datasetImportedBy is empty or undefined` }); } const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/importedby`(path_params); return this.client.post(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), datasetImportedBy, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as DatasetImportedBy); } /** * Returns the set of actions that are part of the specified rule. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the results list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listActionsForRule = (ruleresource: string, args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path_params = { ruleresource: ruleresource }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}/actions`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns the set of annotations across all objects. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the results list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listAnnotations = (args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/annotations`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns the set of annotations that are associated with the specified dashboard. * @param dashboardresource ID or the resource name of a dashvboard. The resource name format is module.dashboardname. * @param args parameters to be sent with the request * @param args.filter A filter query to apply to the annotations. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listAnnotationsForDashboard = (dashboardresource: string, args?: { filter?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path_params = { dashboardresource: dashboardresource }; const path = this.template`/catalog/v2beta1/dashboards/${'dashboardresource'}/annotations`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns the set of annotations that are associated with the specified dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the results list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listAnnotationsForDataset = (datasetresource: string, args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/annotations`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns a list of dashboards. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the results list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listDashboards = (args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/dashboards`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns a list of all datasets. Use a filter to return a specific list of datasets. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the dataset list. The filter must be a SPL predicate expression. * @param args.maxstale The number of seconds beyond which we will refresh index metadata. * @param args.offset The number of results to skip before the first result is returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc\". Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listDatasets = (args?: { count?: number, filter?: string, maxstale?: number, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/datasets`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns a list of all of the fields in the Metadata Catalog. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the dataset list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listFields = (args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/fields`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns the set of fields for the dataset with the specified ID or resource name. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the dataset list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listFieldsForDataset = (datasetresource: string, args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/fields`(path_params); return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns a list of all modules. Use a filter to return a specific list of modules. * @param args parameters to be sent with the request * @param args.filter A filter to apply to the modules. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listModules = (args?: { filter?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/modules`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns a list of all relationships. Use a filter to return a specific list of relationships. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the results list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listRelationships = (args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/relationships`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Returns a list of rules that match a filter, if specified, otherwise returns all rules. * @param args parameters to be sent with the request * @param args.count The maximum number of results to return. * @param args.filter A filter to apply to the results list. The filter must be a SPL predicate expression. * @param args.offset The number of results to skip before the first one returned. * @param args.orderby A list of fields to order the results by. You can specify either ascending or descending order using \" asc\" or \" desc. Ascending order is the default. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ public listRules = (args?: { count?: number, filter?: string, offset?: number, orderby?: Array, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise> => { const path = `/catalog/v2beta1/rules`; return this.client.get(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Array); } /** * Modifies the action with the specified ID that is associated with the specified rule. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param actionid ID of an Action. * @param actionPATCH The properties to update in the specified action. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Action */ public updateActionByIdForRule = (ruleresource: string, actionid: string, actionPATCH: ActionPATCH, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource, actionid: actionid }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}/actions/${'actionid'}`(path_params); return this.client.patch(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), actionPATCH, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Action); } /** * Modifies the dashboard with the specified ID or resource name. * @param dashboardresource ID or the resource name of a dashvboard. The resource name format is module.dashboardname. * @param dashboardPATCH An updated representation of the dashboard to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dashboard */ public updateDashboard = (dashboardresource: string, dashboardPATCH: DashboardPATCH, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { dashboardresource: dashboardresource }; const path = this.template`/catalog/v2beta1/dashboards/${'dashboardresource'}`(path_params); return this.client.patch(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), dashboardPATCH, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Dashboard); } /** * Modifies the dataset with the specified Dataset ID or Resource Name. For the default module, the resource name format is datasetName, otherwise, the resource name format is module.datasetName. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param datasetPATCH An updated representation of the dataset to be persisted. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dataset */ public updateDataset = (datasetresource: string, datasetPATCH: DatasetPATCH, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}`(path_params); return this.client.patch(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), datasetPATCH, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Dataset); } /** * Modifies the field with the specified ID that is part of the specified dataset. * @param datasetresource ID of a Dataset or the resource name of a dataset. For the default module, the resource name format is datasetName. Otherwise, the resource name format is module.datasetName. * @param fieldid ID of a Field. * @param fieldPATCH The properties to update in the specified field, or the requesting user lacks catalog.datasets.read permission for them. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Field */ public updateFieldByIdForDataset = (datasetresource: string, fieldid: string, fieldPATCH: FieldPATCH, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { datasetresource: datasetresource, fieldid: fieldid }; const path = this.template`/catalog/v2beta1/datasets/${'datasetresource'}/fields/${'fieldid'}`(path_params); return this.client.patch(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), fieldPATCH, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Field); } /** * Modifies the relationship with the specified relationship ID. * @param relationshipid ID of a relationship. * @param relationshipPATCH The properties to update in the specified relationship. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Relationship */ public updateRelationshipById = (relationshipid: string, relationshipPATCH: RelationshipPATCH, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { relationshipid: relationshipid }; const path = this.template`/catalog/v2beta1/relationships/${'relationshipid'}`(path_params); return this.client.patch(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), relationshipPATCH, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Relationship); } /** * Modifies the rule with the specified rule ID or resource name. * @param ruleresource The ID or resource name of a rule. For the default module, the resource name format is ruleName. Otherwise, the resource name format is module.ruleName. * @param rulePATCH The properties to update in the specified rule. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Rule */ public updateRule = (ruleresource: string, rulePATCH: RulePATCH, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { ruleresource: ruleresource }; const path = this.template`/catalog/v2beta1/rules/${'ruleresource'}`(path_params); return this.client.patch(CATALOG_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), rulePATCH, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Rule); } } export type CatalogService = GeneratedCatalogService & CatalogServiceExtensions; export const CatalogService = CatalogServiceExtensions(GeneratedCatalogService);