appcenter-cli
Version:
Command line tool for Visual Studio App Center
335 lines (334 loc) • 13.4 kB
JavaScript
"use strict";
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.PushImpl = void 0;
const coreClient = require("@azure/core-client");
const Mappers = require("../models/mappers");
const Parameters = require("../models/parameters");
/** Class containing Push operations. */
class PushImpl {
/**
* Initialize a new instance of the class Push class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Returns whether a push configuration exists for the selected app.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
configExists(ownerName, appName, options) {
return this.client.sendOperationRequest({ ownerName, appName, options }, configExistsOperationSpec);
}
/**
* Get the push configuration for the selected app.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
getConfig(ownerName, appName, options) {
return this.client.sendOperationRequest({ ownerName, appName, options }, getConfigOperationSpec);
}
/**
* Set the push configuration for the selected app.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param properties Notification configurations.
* @param options The options parameters.
*/
setConfig(ownerName, appName, properties, options) {
return this.client.sendOperationRequest({ ownerName, appName, properties, options }, setConfigOperationSpec);
}
/**
* Delete the push configuration for the selected app.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
deleteConfig(ownerName, appName, options) {
return this.client.sendOperationRequest({ ownerName, appName, options }, deleteConfigOperationSpec);
}
/**
* Get details about a specific notification.
* @param notificationId The id of the notification.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
get(notificationId, ownerName, appName, options) {
return this.client.sendOperationRequest({ notificationId, ownerName, appName, options }, getOperationSpec);
}
/**
* Get a list of notifications from the service.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
list(ownerName, appName, options) {
return this.client.sendOperationRequest({ ownerName, appName, options }, listOperationSpec);
}
/**
* Send a notification to one or more devices.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param notificationContent Notification definition object
* @param options The options parameters.
*/
send(ownerName, appName, notificationContent, options) {
return this.client.sendOperationRequest({ ownerName, appName, notificationContent, options }, sendOperationSpec);
}
/**
* Delete a notification.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param values List of notification Ids.
* @param options The options parameters.
*/
delete(ownerName, appName, values, options) {
return this.client.sendOperationRequest({ ownerName, appName, values, options }, deleteOperationSpec);
}
/**
* Delete a device with the selected installId.
* @param installId device install id
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
deleteInstallId(installId, ownerName, appName, options) {
return this.client.sendOperationRequest({ installId, ownerName, appName, options }, deleteInstallIdOperationSpec);
}
/**
* Get the status of an export operation.
* @param exportId The id of the export.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
exportDevicesStatus(exportId, ownerName, appName, options) {
return this.client.sendOperationRequest({ exportId, ownerName, appName, options }, exportDevicesStatusOperationSpec);
}
/**
* Exports information for all devices using Push to Azure Blob Storage
* @param ownerName The name of the owner
* @param appName The name of the application
* @param blobContainerSasUri A shared access signature (SAS) URI with Read, Write and Delete
* permissions on a container.
* @param options The options parameters.
*/
exportDevices(ownerName, appName, blobContainerSasUri, options) {
return this.client.sendOperationRequest({ ownerName, appName, blobContainerSasUri, options }, exportDevicesOperationSpec);
}
}
exports.PushImpl = PushImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const configExistsOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications_config",
httpMethod: "HEAD",
responses: {
204: {},
404: {},
default: {
bodyMapper: Mappers.Paths1Hot65IV01AppsOwnerNameAppNamePushNotificationsConfigHeadResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};
const getConfigOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications_config",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Paths1C7Oun7V01AppsOwnerNameAppNamePushNotificationsConfigGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.PathsO0Ll17V01AppsOwnerNameAppNamePushNotificationsConfigGetResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};
const setConfigOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications_config",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.Paths176Xq3CV01AppsOwnerNameAppNamePushNotificationsConfigPutResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.PathsFgy7YfV01AppsOwnerNameAppNamePushNotificationsConfigPutResponsesDefaultContentApplicationJsonSchema
}
},
requestBody: Parameters.properties1,
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const deleteConfigOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications_config",
httpMethod: "DELETE",
responses: {
200: {},
default: {
bodyMapper: Mappers.PathsFm6Bs9V01AppsOwnerNameAppNamePushNotificationsConfigDeleteResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications/{notification_id}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Paths1NjrudiV01AppsOwnerNameAppNamePushNotificationsNotificationIdGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.PathsY2MpnfV01AppsOwnerNameAppNamePushNotificationsNotificationIdGetResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.notificationId
],
headerParameters: [Parameters.accept],
serializer
};
const listOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Paths1YjfjrmV01AppsOwnerNameAppNamePushNotificationsGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.Paths1Ua4CuvV01AppsOwnerNameAppNamePushNotificationsGetResponsesDefaultContentApplicationJsonSchema
}
},
queryParameters: [
Parameters.top1,
Parameters.skiptoken,
Parameters.orderby,
Parameters.inlinecount,
Parameters.includeArchived
],
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};
const sendOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications",
httpMethod: "POST",
responses: {
202: {
bodyMapper: Mappers.PathsKpnezyV01AppsOwnerNameAppNamePushNotificationsPostResponses202ContentApplicationJsonSchema,
headersMapper: Mappers.PushSendHeaders
},
default: {
bodyMapper: Mappers.Paths1Kwjsi2V01AppsOwnerNameAppNamePushNotificationsPostResponsesDefaultContentApplicationJsonSchema
}
},
requestBody: {
parameterPath: {
notificationTarget: ["options", "notificationTarget"],
notificationContent: ["notificationContent"]
},
mapper: Object.assign(Object.assign({}, Mappers.Paths13Dzhd2V01AppsOwnerNameAppNamePushNotificationsPostRequestbodyContentApplicationJsonSchema), { required: true })
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const deleteOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/notifications",
httpMethod: "DELETE",
responses: {
200: {},
default: {
bodyMapper: Mappers.PathsC8NkptV01AppsOwnerNameAppNamePushNotificationsDeleteResponsesDefaultContentApplicationJsonSchema
}
},
requestBody: {
parameterPath: { values: ["values"] },
mapper: Object.assign(Object.assign({}, Mappers.Paths5M7Cf2V01AppsOwnerNameAppNamePushNotificationsDeleteRequestbodyContentApplicationJsonSchema), { required: true })
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const deleteInstallIdOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/devices/{install_id}",
httpMethod: "DELETE",
responses: {
200: {},
default: {
bodyMapper: Mappers.Paths11E7Jh9V01AppsOwnerNameAppNamePushDevicesInstallIdDeleteResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.installId
],
headerParameters: [Parameters.accept],
serializer
};
const exportDevicesStatusOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/device_exports/{export_id}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Paths1UomvgvV01AppsOwnerNameAppNamePushDeviceExportsExportIdGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.Paths18Cvs3GV01AppsOwnerNameAppNamePushDeviceExportsExportIdGetResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.exportId
],
headerParameters: [Parameters.accept],
serializer
};
const exportDevicesOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/push/device_exports",
httpMethod: "POST",
responses: {
202: {
bodyMapper: Mappers.Paths11Qat48V01AppsOwnerNameAppNamePushDeviceExportsPostResponses202ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.Paths801PuuV01AppsOwnerNameAppNamePushDeviceExportsPostResponsesDefaultContentApplicationJsonSchema
}
},
requestBody: {
parameterPath: { blobContainerSasUri: ["blobContainerSasUri"] },
mapper: Object.assign(Object.assign({}, Mappers.Paths1H0K4SgV01AppsOwnerNameAppNamePushDeviceExportsPostRequestbodyContentApplicationJsonSchema), { required: true })
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};