diff --git a/lib/services/storagesyncManagement/lib/models/cloudEndpoint.js b/lib/services/storagesyncManagement/lib/models/cloudEndpoint.js index 28a4f7ec4e..fcd8ff7b3d 100644 --- a/lib/services/storagesyncManagement/lib/models/cloudEndpoint.js +++ b/lib/services/storagesyncManagement/lib/models/cloudEndpoint.js @@ -15,9 +15,9 @@ const models = require('./index'); /** * Cloud Endpoint object. * - * @extends models['Resource'] + * @extends models['ProxyResource'] */ -class CloudEndpoint extends models['Resource'] { +class CloudEndpoint extends models['ProxyResource'] { /** * Create a CloudEndpoint. * @member {string} [storageAccountResourceId] Storage Account Resource Id diff --git a/lib/services/storagesyncManagement/lib/models/cloudEndpointCreateParameters.js b/lib/services/storagesyncManagement/lib/models/cloudEndpointCreateParameters.js index 44475c876c..f97c739114 100644 --- a/lib/services/storagesyncManagement/lib/models/cloudEndpointCreateParameters.js +++ b/lib/services/storagesyncManagement/lib/models/cloudEndpointCreateParameters.js @@ -10,29 +10,22 @@ 'use strict'; +const models = require('./index'); + /** - * The parameters used when creating a storage sync service. + * The parameters used when creating a cloud endpoint. * + * @extends models['ProxyResource'] */ -class CloudEndpointCreateParameters { +class CloudEndpointCreateParameters extends models['ProxyResource'] { /** * Create a CloudEndpointCreateParameters. - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that - * describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be - * provided for a resource. Each tag must have a key with a length no greater - * than 128 characters and a value with a length no greater than 256 - * characters. * @member {string} [storageAccountResourceId] Storage Account Resource Id * @member {string} [storageAccountShareName] Storage Account Share name * @member {string} [storageAccountTenantId] Storage Account Tenant Id */ constructor() { + super(); } /** @@ -49,25 +42,28 @@ class CloudEndpointCreateParameters { name: 'Composite', className: 'CloudEndpointCreateParameters', modelProperties: { - location: { + id: { required: false, - serializedName: 'location', + readOnly: true, + serializedName: 'id', type: { name: 'String' } }, - tags: { + name: { required: false, - serializedName: 'tags', + readOnly: true, + serializedName: 'name', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' } }, storageAccountResourceId: { diff --git a/lib/services/storagesyncManagement/lib/models/index.d.ts b/lib/services/storagesyncManagement/lib/models/index.d.ts index 3c76db6922..86982db10e 100644 --- a/lib/services/storagesyncManagement/lib/models/index.d.ts +++ b/lib/services/storagesyncManagement/lib/models/index.d.ts @@ -143,6 +143,17 @@ export interface StorageSyncService extends TrackedResource { readonly storageSyncServiceUid?: string; } +/** + * @class + * Initializes a new instance of the ProxyResource class. + * @constructor + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags + * + */ +export interface ProxyResource extends Resource { +} + /** * @class * Initializes a new instance of the SyncGroup class. @@ -152,7 +163,7 @@ export interface StorageSyncService extends TrackedResource { * @member {string} [uniqueId] Unique Id * @member {string} [syncGroupStatus] Sync group status */ -export interface SyncGroup extends Resource { +export interface SyncGroup extends ProxyResource { uniqueId?: string; readonly syncGroupStatus?: string; } @@ -173,7 +184,7 @@ export interface SyncGroup extends Resource { * @member {string} [lastWorkflowId] CloudEndpoint lastWorkflowId * @member {string} [lastOperationName] Resource Last Operation Name */ -export interface CloudEndpoint extends Resource { +export interface CloudEndpoint extends ProxyResource { storageAccountResourceId?: string; storageAccountShareName?: string; storageAccountTenantId?: string; @@ -205,7 +216,7 @@ export interface RecallActionParameters { * @constructor * The parameters used when creating a storage sync service. * - * @member {string} [location] Required. Gets or sets the location of the + * @member {string} location Required. Gets or sets the location of the * resource. This will be one of the supported and registered Azure Geo Regions * (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource * cannot be changed once it is created, but if an identical geo region is @@ -215,10 +226,12 @@ export interface RecallActionParameters { * (across resource groups). A maximum of 15 tags can be provided for a * resource. Each tag must have a key with a length no greater than 128 * characters and a value with a length no greater than 256 characters. + * @member {object} [properties] */ export interface StorageSyncServiceCreateParameters { - location?: string; + location: string; tags?: { [propertyName: string]: string }; + properties?: any; } /** @@ -227,21 +240,9 @@ export interface StorageSyncServiceCreateParameters { * @constructor * The parameters used when creating a sync group. * - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo Regions - * (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource - * cannot be changed once it is created, but if an identical geo region is - * specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that describe - * the resource. These tags can be used for viewing and grouping this resource - * (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. * @member {object} [properties] The parameters used to create the sync group */ -export interface SyncGroupCreateParameters { - location?: string; - tags?: { [propertyName: string]: string }; +export interface SyncGroupCreateParameters extends ProxyResource { properties?: any; } @@ -249,25 +250,13 @@ export interface SyncGroupCreateParameters { * @class * Initializes a new instance of the CloudEndpointCreateParameters class. * @constructor - * The parameters used when creating a storage sync service. + * The parameters used when creating a cloud endpoint. * - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo Regions - * (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource - * cannot be changed once it is created, but if an identical geo region is - * specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that describe - * the resource. These tags can be used for viewing and grouping this resource - * (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. * @member {string} [storageAccountResourceId] Storage Account Resource Id * @member {string} [storageAccountShareName] Storage Account Share name * @member {string} [storageAccountTenantId] Storage Account Tenant Id */ -export interface CloudEndpointCreateParameters { - location?: string; - tags?: { [propertyName: string]: string }; +export interface CloudEndpointCreateParameters extends ProxyResource { storageAccountResourceId?: string; storageAccountShareName?: string; storageAccountTenantId?: string; @@ -277,52 +266,44 @@ export interface CloudEndpointCreateParameters { * @class * Initializes a new instance of the ServerEndpointCreateParameters class. * @constructor - * The parameters used when creating a storage sync service. + * The parameters used when creating a server endpoint. * - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo Regions - * (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource - * cannot be changed once it is created, but if an identical geo region is - * specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that describe - * the resource. These tags can be used for viewing and grouping this resource - * (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. * @member {string} [serverLocalPath] Server Local path. * @member {string} [cloudTiering] Cloud Tiering. Possible values include: * 'on', 'off' * @member {number} [volumeFreeSpacePercent] Level of free space to be * maintained by Cloud Tiering if it is enabled. + * @member {number} [tierFilesOlderThanDays] Tier files older than days. * @member {string} [friendlyName] Friendly Name * @member {string} [serverResourceId] Server Resource Id. */ -export interface ServerEndpointCreateParameters { - location?: string; - tags?: { [propertyName: string]: string }; +export interface ServerEndpointCreateParameters extends ProxyResource { serverLocalPath?: string; cloudTiering?: string; volumeFreeSpacePercent?: number; + tierFilesOlderThanDays?: number; friendlyName?: string; serverResourceId?: string; } +/** + * @class + * Initializes a new instance of the TriggerRolloverRequest class. + * @constructor + * Trigger Rollover Request. + * + * @member {string} [certificateData] Certificate Data + */ +export interface TriggerRolloverRequest { + certificateData?: string; +} + /** * @class * Initializes a new instance of the RegisteredServerCreateParameters class. * @constructor - * The parameters used when creating a storage sync service. + * The parameters used when creating a registered server. * - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo Regions - * (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource - * cannot be changed once it is created, but if an identical geo region is - * specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that describe - * the resource. These tags can be used for viewing and grouping this resource - * (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. * @member {string} [serverCertificate] Registered Server Certificate * @member {string} [agentVersion] Registered Server Agent Version * @member {string} [serverOSVersion] Registered Server OS Version @@ -333,9 +314,7 @@ export interface ServerEndpointCreateParameters { * @member {string} [serverId] Registered Server serverId * @member {string} [friendlyName] Friendly Name */ -export interface RegisteredServerCreateParameters { - location?: string; - tags?: { [propertyName: string]: string }; +export interface RegisteredServerCreateParameters extends ProxyResource { serverCertificate?: string; agentVersion?: string; serverOSVersion?: string; @@ -353,17 +332,16 @@ export interface RegisteredServerCreateParameters { * @constructor * Parameters for updating an Server Endpoint. * - * @member {object} [tags] The user-specified tags associated with the server - * endpoint. * @member {string} [cloudTiering] Cloud Tiering. Possible values include: * 'on', 'off' * @member {number} [volumeFreeSpacePercent] Level of free space to be * maintained by Cloud Tiering if it is enabled. + * @member {number} [tierFilesOlderThanDays] Tier files older than days. */ export interface ServerEndpointUpdateParameters { - tags?: { [propertyName: string]: string }; cloudTiering?: string; volumeFreeSpacePercent?: number; + tierFilesOlderThanDays?: number; } /** @@ -377,6 +355,7 @@ export interface ServerEndpointUpdateParameters { * 'on', 'off' * @member {number} [volumeFreeSpacePercent] Level of free space to be * maintained by Cloud Tiering if it is enabled. + * @member {number} [tierFilesOlderThanDays] Tier files older than days. * @member {string} [friendlyName] Friendly Name * @member {string} [serverResourceId] Server Resource Id. * @member {string} [provisioningState] ServerEndpoint Provisioning State @@ -384,10 +363,11 @@ export interface ServerEndpointUpdateParameters { * @member {string} [lastOperationName] Resource Last Operation Name * @member {object} [syncStatus] Sync Health Status */ -export interface ServerEndpoint extends Resource { +export interface ServerEndpoint extends ProxyResource { serverLocalPath?: string; cloudTiering?: string; volumeFreeSpacePercent?: number; + tierFilesOlderThanDays?: number; friendlyName?: string; serverResourceId?: string; provisioningState?: string; @@ -423,7 +403,7 @@ export interface ServerEndpoint extends Resource { * @member {string} [friendlyName] Friendly Name * @member {string} [managementEndpointUri] Management Endpoint Uri */ -export interface RegisteredServer extends Resource { +export interface RegisteredServer extends ProxyResource { serverCertificate?: string; agentVersion?: string; serverOSVersion?: string; @@ -472,7 +452,7 @@ export interface ResourcesMoveInfo { * @member {string} [steps] workflow steps * @member {string} [lastOperationId] workflow last operation identifier. */ -export interface Workflow extends Resource { +export interface Workflow extends ProxyResource { lastStepName?: string; status?: string; operation?: string; @@ -669,18 +649,6 @@ export interface PostBackupResponse { readonly cloudEndpointName?: string; } -/** - * @class - * Initializes a new instance of the WorkflowArray class. - * @constructor - * Array of Workflow - * - * @member {array} [value] Collection of workflow items. - */ -export interface WorkflowArray { - value?: Workflow[]; -} - /** * @class * Initializes a new instance of the StorageSyncServiceUpdateParameters class. @@ -696,17 +664,6 @@ export interface StorageSyncServiceUpdateParameters { properties?: any; } -/** - * @class - * Initializes a new instance of the ProxyResource class. - * @constructor - * The resource model definition for a ARM proxy resource. It will have - * everything other than required location and tags - * - */ -export interface ProxyResource extends Resource { -} - /** * @class * Initializes a new instance of the AzureEntityResource class. @@ -783,3 +740,13 @@ export interface ServerEndpointArray extends Array { */ export interface RegisteredServerArray extends Array { } + +/** + * @class + * Initializes a new instance of the WorkflowArray class. + * @constructor + * Array of Workflow + * + */ +export interface WorkflowArray extends Array { +} diff --git a/lib/services/storagesyncManagement/lib/models/index.js b/lib/services/storagesyncManagement/lib/models/index.js index 696805cb3d..0f5b9cbd94 100644 --- a/lib/services/storagesyncManagement/lib/models/index.js +++ b/lib/services/storagesyncManagement/lib/models/index.js @@ -25,6 +25,7 @@ exports.SubscriptionState = require('./subscriptionState'); exports.Resource = require('./resource'); exports.TrackedResource = require('./trackedResource'); exports.StorageSyncService = require('./storageSyncService'); +exports.ProxyResource = require('./proxyResource'); exports.SyncGroup = require('./syncGroup'); exports.CloudEndpoint = require('./cloudEndpoint'); exports.RecallActionParameters = require('./recallActionParameters'); @@ -32,6 +33,7 @@ exports.StorageSyncServiceCreateParameters = require('./storageSyncServiceCreate exports.SyncGroupCreateParameters = require('./syncGroupCreateParameters'); exports.CloudEndpointCreateParameters = require('./cloudEndpointCreateParameters'); exports.ServerEndpointCreateParameters = require('./serverEndpointCreateParameters'); +exports.TriggerRolloverRequest = require('./triggerRolloverRequest'); exports.RegisteredServerCreateParameters = require('./registeredServerCreateParameters'); exports.ServerEndpointUpdateParameters = require('./serverEndpointUpdateParameters'); exports.ServerEndpoint = require('./serverEndpoint'); @@ -48,9 +50,7 @@ exports.PostRestoreRequest = require('./postRestoreRequest'); exports.PreRestoreRequest = require('./preRestoreRequest'); exports.BackupRequest = require('./backupRequest'); exports.PostBackupResponse = require('./postBackupResponse'); -exports.WorkflowArray = require('./workflowArray'); exports.StorageSyncServiceUpdateParameters = require('./storageSyncServiceUpdateParameters'); -exports.ProxyResource = require('./proxyResource'); exports.AzureEntityResource = require('./azureEntityResource'); exports.OperationEntityListResult = require('./operationEntityListResult'); exports.StorageSyncServiceArray = require('./storageSyncServiceArray'); @@ -58,3 +58,4 @@ exports.SyncGroupArray = require('./syncGroupArray'); exports.CloudEndpointArray = require('./cloudEndpointArray'); exports.ServerEndpointArray = require('./serverEndpointArray'); exports.RegisteredServerArray = require('./registeredServerArray'); +exports.WorkflowArray = require('./workflowArray'); diff --git a/lib/services/storagesyncManagement/lib/models/registeredServer.js b/lib/services/storagesyncManagement/lib/models/registeredServer.js index 9847aa9b8b..0e89a90e8c 100644 --- a/lib/services/storagesyncManagement/lib/models/registeredServer.js +++ b/lib/services/storagesyncManagement/lib/models/registeredServer.js @@ -15,9 +15,9 @@ const models = require('./index'); /** * Registered Server resource. * - * @extends models['Resource'] + * @extends models['ProxyResource'] */ -class RegisteredServer extends models['Resource'] { +class RegisteredServer extends models['ProxyResource'] { /** * Create a RegisteredServer. * @member {string} [serverCertificate] Registered Server Certificate diff --git a/lib/services/storagesyncManagement/lib/models/registeredServerCreateParameters.js b/lib/services/storagesyncManagement/lib/models/registeredServerCreateParameters.js index 0bfd317a37..0aaa1045fc 100644 --- a/lib/services/storagesyncManagement/lib/models/registeredServerCreateParameters.js +++ b/lib/services/storagesyncManagement/lib/models/registeredServerCreateParameters.js @@ -10,24 +10,16 @@ 'use strict'; +const models = require('./index'); + /** - * The parameters used when creating a storage sync service. + * The parameters used when creating a registered server. * + * @extends models['ProxyResource'] */ -class RegisteredServerCreateParameters { +class RegisteredServerCreateParameters extends models['ProxyResource'] { /** * Create a RegisteredServerCreateParameters. - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that - * describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be - * provided for a resource. Each tag must have a key with a length no greater - * than 128 characters and a value with a length no greater than 256 - * characters. * @member {string} [serverCertificate] Registered Server Certificate * @member {string} [agentVersion] Registered Server Agent Version * @member {string} [serverOSVersion] Registered Server OS Version @@ -39,6 +31,7 @@ class RegisteredServerCreateParameters { * @member {string} [friendlyName] Friendly Name */ constructor() { + super(); } /** @@ -55,25 +48,28 @@ class RegisteredServerCreateParameters { name: 'Composite', className: 'RegisteredServerCreateParameters', modelProperties: { - location: { + id: { required: false, - serializedName: 'location', + readOnly: true, + serializedName: 'id', type: { name: 'String' } }, - tags: { + name: { required: false, - serializedName: 'tags', + readOnly: true, + serializedName: 'name', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' } }, serverCertificate: { diff --git a/lib/services/storagesyncManagement/lib/models/serverEndpoint.js b/lib/services/storagesyncManagement/lib/models/serverEndpoint.js index 488195a83d..6a7308141f 100644 --- a/lib/services/storagesyncManagement/lib/models/serverEndpoint.js +++ b/lib/services/storagesyncManagement/lib/models/serverEndpoint.js @@ -15,9 +15,9 @@ const models = require('./index'); /** * Server Endpoint object. * - * @extends models['Resource'] + * @extends models['ProxyResource'] */ -class ServerEndpoint extends models['Resource'] { +class ServerEndpoint extends models['ProxyResource'] { /** * Create a ServerEndpoint. * @member {string} [serverLocalPath] Server Local path. @@ -25,6 +25,7 @@ class ServerEndpoint extends models['Resource'] { * 'on', 'off' * @member {number} [volumeFreeSpacePercent] Level of free space to be * maintained by Cloud Tiering if it is enabled. + * @member {number} [tierFilesOlderThanDays] Tier files older than days. * @member {string} [friendlyName] Friendly Name * @member {string} [serverResourceId] Server Resource Id. * @member {string} [provisioningState] ServerEndpoint Provisioning State @@ -99,6 +100,17 @@ class ServerEndpoint extends models['Resource'] { name: 'Number' } }, + tierFilesOlderThanDays: { + required: false, + serializedName: 'properties.tierFilesOlderThanDays', + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, friendlyName: { required: false, serializedName: 'properties.friendlyName', diff --git a/lib/services/storagesyncManagement/lib/models/serverEndpointCreateParameters.js b/lib/services/storagesyncManagement/lib/models/serverEndpointCreateParameters.js index 1de8c64a0e..fe0c1bcd95 100644 --- a/lib/services/storagesyncManagement/lib/models/serverEndpointCreateParameters.js +++ b/lib/services/storagesyncManagement/lib/models/serverEndpointCreateParameters.js @@ -10,33 +10,27 @@ 'use strict'; +const models = require('./index'); + /** - * The parameters used when creating a storage sync service. + * The parameters used when creating a server endpoint. * + * @extends models['ProxyResource'] */ -class ServerEndpointCreateParameters { +class ServerEndpointCreateParameters extends models['ProxyResource'] { /** * Create a ServerEndpointCreateParameters. - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that - * describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be - * provided for a resource. Each tag must have a key with a length no greater - * than 128 characters and a value with a length no greater than 256 - * characters. * @member {string} [serverLocalPath] Server Local path. * @member {string} [cloudTiering] Cloud Tiering. Possible values include: * 'on', 'off' * @member {number} [volumeFreeSpacePercent] Level of free space to be * maintained by Cloud Tiering if it is enabled. + * @member {number} [tierFilesOlderThanDays] Tier files older than days. * @member {string} [friendlyName] Friendly Name * @member {string} [serverResourceId] Server Resource Id. */ constructor() { + super(); } /** @@ -53,25 +47,28 @@ class ServerEndpointCreateParameters { name: 'Composite', className: 'ServerEndpointCreateParameters', modelProperties: { - location: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { required: false, - serializedName: 'location', + readOnly: true, + serializedName: 'name', type: { name: 'String' } }, - tags: { + type: { required: false, - serializedName: 'tags', + readOnly: true, + serializedName: 'type', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' } }, serverLocalPath: { @@ -99,6 +96,17 @@ class ServerEndpointCreateParameters { name: 'Number' } }, + tierFilesOlderThanDays: { + required: false, + serializedName: 'properties.tierFilesOlderThanDays', + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, friendlyName: { required: false, serializedName: 'properties.friendlyName', diff --git a/lib/services/storagesyncManagement/lib/models/serverEndpointUpdateParameters.js b/lib/services/storagesyncManagement/lib/models/serverEndpointUpdateParameters.js index ade855fed0..dc2722d596 100644 --- a/lib/services/storagesyncManagement/lib/models/serverEndpointUpdateParameters.js +++ b/lib/services/storagesyncManagement/lib/models/serverEndpointUpdateParameters.js @@ -17,12 +17,11 @@ class ServerEndpointUpdateParameters { /** * Create a ServerEndpointUpdateParameters. - * @member {object} [tags] The user-specified tags associated with the server - * endpoint. * @member {string} [cloudTiering] Cloud Tiering. Possible values include: * 'on', 'off' * @member {number} [volumeFreeSpacePercent] Level of free space to be * maintained by Cloud Tiering if it is enabled. + * @member {number} [tierFilesOlderThanDays] Tier files older than days. */ constructor() { } @@ -41,20 +40,6 @@ class ServerEndpointUpdateParameters { name: 'Composite', className: 'ServerEndpointUpdateParameters', modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, cloudTiering: { required: false, serializedName: 'properties.cloudTiering', @@ -72,6 +57,17 @@ class ServerEndpointUpdateParameters { type: { name: 'Number' } + }, + tierFilesOlderThanDays: { + required: false, + serializedName: 'properties.tierFilesOlderThanDays', + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/storagesyncManagement/lib/models/storageSyncServiceCreateParameters.js b/lib/services/storagesyncManagement/lib/models/storageSyncServiceCreateParameters.js index d35819cecf..776dcaf1fc 100644 --- a/lib/services/storagesyncManagement/lib/models/storageSyncServiceCreateParameters.js +++ b/lib/services/storagesyncManagement/lib/models/storageSyncServiceCreateParameters.js @@ -17,7 +17,7 @@ class StorageSyncServiceCreateParameters { /** * Create a StorageSyncServiceCreateParameters. - * @member {string} [location] Required. Gets or sets the location of the + * @member {string} location Required. Gets or sets the location of the * resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a * resource cannot be changed once it is created, but if an identical geo @@ -28,6 +28,7 @@ class StorageSyncServiceCreateParameters { * provided for a resource. Each tag must have a key with a length no greater * than 128 characters and a value with a length no greater than 256 * characters. + * @member {object} [properties] */ constructor() { } @@ -47,7 +48,7 @@ class StorageSyncServiceCreateParameters { className: 'StorageSyncServiceCreateParameters', modelProperties: { location: { - required: false, + required: true, serializedName: 'location', type: { name: 'String' @@ -66,6 +67,13 @@ class StorageSyncServiceCreateParameters { } } } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Object' + } } } } diff --git a/lib/services/storagesyncManagement/lib/models/syncGroup.js b/lib/services/storagesyncManagement/lib/models/syncGroup.js index 5e54d54cc6..d66fe945b0 100644 --- a/lib/services/storagesyncManagement/lib/models/syncGroup.js +++ b/lib/services/storagesyncManagement/lib/models/syncGroup.js @@ -15,9 +15,9 @@ const models = require('./index'); /** * Sync Group object. * - * @extends models['Resource'] + * @extends models['ProxyResource'] */ -class SyncGroup extends models['Resource'] { +class SyncGroup extends models['ProxyResource'] { /** * Create a SyncGroup. * @member {string} [uniqueId] Unique Id diff --git a/lib/services/storagesyncManagement/lib/models/syncGroupCreateParameters.js b/lib/services/storagesyncManagement/lib/models/syncGroupCreateParameters.js index 694015b9f5..1dd6690814 100644 --- a/lib/services/storagesyncManagement/lib/models/syncGroupCreateParameters.js +++ b/lib/services/storagesyncManagement/lib/models/syncGroupCreateParameters.js @@ -10,27 +10,20 @@ 'use strict'; +const models = require('./index'); + /** * The parameters used when creating a sync group. * + * @extends models['ProxyResource'] */ -class SyncGroupCreateParameters { +class SyncGroupCreateParameters extends models['ProxyResource'] { /** * Create a SyncGroupCreateParameters. - * @member {string} [location] Required. Gets or sets the location of the - * resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * @member {object} [tags] Gets or sets a list of key value pairs that - * describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be - * provided for a resource. Each tag must have a key with a length no greater - * than 128 characters and a value with a length no greater than 256 - * characters. * @member {object} [properties] The parameters used to create the sync group */ constructor() { + super(); } /** @@ -47,25 +40,28 @@ class SyncGroupCreateParameters { name: 'Composite', className: 'SyncGroupCreateParameters', modelProperties: { - location: { + id: { required: false, - serializedName: 'location', + readOnly: true, + serializedName: 'id', type: { name: 'String' } }, - tags: { + name: { required: false, - serializedName: 'tags', + readOnly: true, + serializedName: 'name', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' } }, properties: { diff --git a/lib/services/storagesyncManagement/lib/models/triggerRolloverRequest.js b/lib/services/storagesyncManagement/lib/models/triggerRolloverRequest.js new file mode 100644 index 0000000000..696b651e5c --- /dev/null +++ b/lib/services/storagesyncManagement/lib/models/triggerRolloverRequest.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Trigger Rollover Request. + * + */ +class TriggerRolloverRequest { + /** + * Create a TriggerRolloverRequest. + * @member {string} [certificateData] Certificate Data + */ + constructor() { + } + + /** + * Defines the metadata of TriggerRolloverRequest + * + * @returns {object} metadata of TriggerRolloverRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggerRolloverRequest', + type: { + name: 'Composite', + className: 'TriggerRolloverRequest', + modelProperties: { + certificateData: { + required: false, + serializedName: 'certificateData', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TriggerRolloverRequest; diff --git a/lib/services/storagesyncManagement/lib/models/workflow.js b/lib/services/storagesyncManagement/lib/models/workflow.js index 750baff9bd..b6fcb81fed 100644 --- a/lib/services/storagesyncManagement/lib/models/workflow.js +++ b/lib/services/storagesyncManagement/lib/models/workflow.js @@ -15,9 +15,9 @@ const models = require('./index'); /** * Workflow resource. * - * @extends models['Resource'] + * @extends models['ProxyResource'] */ -class Workflow extends models['Resource'] { +class Workflow extends models['ProxyResource'] { /** * Create a Workflow. * @member {string} [lastStepName] last step name diff --git a/lib/services/storagesyncManagement/lib/models/workflowArray.js b/lib/services/storagesyncManagement/lib/models/workflowArray.js index c2c3eb737f..7e56806a47 100644 --- a/lib/services/storagesyncManagement/lib/models/workflowArray.js +++ b/lib/services/storagesyncManagement/lib/models/workflowArray.js @@ -12,14 +12,13 @@ /** * Array of Workflow - * */ -class WorkflowArray { +class WorkflowArray extends Array { /** * Create a WorkflowArray. - * @member {array} [value] Collection of workflow items. */ constructor() { + super(); } /** @@ -38,7 +37,7 @@ class WorkflowArray { modelProperties: { value: { required: false, - serializedName: 'value', + serializedName: '', type: { name: 'Sequence', element: { diff --git a/lib/services/storagesyncManagement/lib/operations/cloudEndpoints.js b/lib/services/storagesyncManagement/lib/operations/cloudEndpoints.js index d52c90fa06..d4ea73b12f 100644 --- a/lib/services/storagesyncManagement/lib/operations/cloudEndpoints.js +++ b/lib/services/storagesyncManagement/lib/operations/cloudEndpoints.js @@ -30,18 +30,6 @@ const WebResource = msRest.WebResource; * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -1085,18 +1073,6 @@ function _postRestore(resourceGroupName, storageSyncServiceName, syncGroupName, * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -2317,18 +2293,6 @@ class CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -2378,18 +2342,6 @@ class CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -3346,18 +3298,6 @@ class CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -3407,18 +3347,6 @@ class CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * diff --git a/lib/services/storagesyncManagement/lib/operations/index.d.ts b/lib/services/storagesyncManagement/lib/operations/index.d.ts index d39f996a56..6ba52d1801 100644 --- a/lib/services/storagesyncManagement/lib/operations/index.d.ts +++ b/lib/services/storagesyncManagement/lib/operations/index.d.ts @@ -217,7 +217,7 @@ export interface StorageSyncServices { * * @param {object} parameters Storage Sync Service resource name. * - * @param {string} [parameters.location] Required. Gets or sets the location of + * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a * resource cannot be changed once it is created, but if an identical geo @@ -229,6 +229,8 @@ export interface StorageSyncServices { * for a resource. Each tag must have a key with a length no greater than 128 * characters and a value with a length no greater than 256 characters. * + * @param {object} [parameters.properties] + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -253,7 +255,7 @@ export interface StorageSyncServices { * * @param {object} parameters Storage Sync Service resource name. * - * @param {string} [parameters.location] Required. Gets or sets the location of + * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a * resource cannot be changed once it is created, but if an identical geo @@ -265,6 +267,8 @@ export interface StorageSyncServices { * for a resource. Each tag must have a key with a length no greater than 128 * characters and a value with a length no greater than 256 characters. * + * @param {object} [parameters.properties] + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -696,18 +700,6 @@ export interface SyncGroups { * * @param {object} parameters Sync Group Body * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {object} [parameters.properties] The parameters used to create the * sync group * @@ -737,18 +729,6 @@ export interface SyncGroups { * * @param {object} parameters Sync Group Body * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {object} [parameters.properties] The parameters used to create the * sync group * @@ -941,18 +921,6 @@ export interface CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -990,18 +958,6 @@ export interface CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -1727,18 +1683,6 @@ export interface CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -1776,18 +1720,6 @@ export interface CloudEndpoints { * * @param {object} parameters Body of Cloud Endpoint resource. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.storageAccountResourceId] Storage Account * Resource Id * @@ -2314,18 +2246,6 @@ export interface ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -2334,6 +2254,9 @@ export interface ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -2366,18 +2289,6 @@ export interface ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -2386,6 +2297,9 @@ export interface ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -2440,15 +2354,15 @@ export interface ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2478,15 +2392,15 @@ export interface ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2822,18 +2736,6 @@ export interface ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -2842,6 +2744,9 @@ export interface ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -2874,18 +2779,6 @@ export interface ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -2894,6 +2787,9 @@ export interface ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -2948,15 +2844,15 @@ export interface ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2986,15 +2882,15 @@ export interface ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3329,18 +3225,6 @@ export interface RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -3385,18 +3269,6 @@ export interface RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -3513,6 +3385,80 @@ export interface RegisteredServers { deleteMethod(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + triggerRolloverWithHttpOperationResponse(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + triggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + triggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, callback: ServiceCallback): void; + triggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Add a new registered server. * @@ -3526,18 +3472,6 @@ export interface RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -3582,18 +3516,6 @@ export interface RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -3708,6 +3630,80 @@ export interface RegisteredServers { beginDeleteMethod(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginDeleteMethod(resourceGroupName: string, storageSyncServiceName: string, serverId: string, callback: ServiceCallback): void; beginDeleteMethod(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginTriggerRolloverWithHttpOperationResponse(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginTriggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginTriggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, callback: ServiceCallback): void; + beginTriggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: models.TriggerRolloverRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -3719,6 +3715,69 @@ export interface RegisteredServers { export interface Workflows { + /** + * Get a Workflow List + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByStorageSyncServiceWithHttpOperationResponse(resourceGroupName: string, storageSyncServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get a Workflow List + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WorkflowArray} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WorkflowArray} [result] - The deserialized result object if an error did not occur. + * See {@link WorkflowArray} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, callback: ServiceCallback): void; + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Get Workflows resource * diff --git a/lib/services/storagesyncManagement/lib/operations/registeredServers.js b/lib/services/storagesyncManagement/lib/operations/registeredServers.js index 3e75357ffd..c9d533adda 100644 --- a/lib/services/storagesyncManagement/lib/operations/registeredServers.js +++ b/lib/services/storagesyncManagement/lib/operations/registeredServers.js @@ -382,18 +382,6 @@ function _get(resourceGroupName, storageSyncServiceName, serverId, options, call * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -549,6 +537,77 @@ function _deleteMethod(resourceGroupName, storageSyncServiceName, serverId, opti }); } + +/** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginTriggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + /** * Add a new registered server. * @@ -562,18 +621,6 @@ function _deleteMethod(resourceGroupName, storageSyncServiceName, serverId, opti * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -940,6 +987,189 @@ function _beginDeleteMethod(resourceGroupName, storageSyncServiceName, serverId, }); } +/** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginTriggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.length < 1) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { + if (this.client.apiVersion.length < 1) + { + throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); + } + } + if (storageSyncServiceName === null || storageSyncServiceName === undefined || typeof storageSyncServiceName.valueOf() !== 'string') { + throw new Error('storageSyncServiceName cannot be null or undefined and it must be of type string.'); + } + if (serverId === null || serverId === undefined || typeof serverId.valueOf() !== 'string') { + throw new Error('serverId cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{storageSyncServiceName}', encodeURIComponent(storageSyncServiceName)); + requestUrl = requestUrl.replace('{serverId}', encodeURIComponent(serverId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TriggerRolloverRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['StorageSyncError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + /** Class representing a RegisteredServers. */ class RegisteredServers { /** @@ -952,8 +1182,10 @@ class RegisteredServers { this._get = _get; this._create = _create; this._deleteMethod = _deleteMethod; + this._triggerRollover = _triggerRollover; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; + this._beginTriggerRollover = _beginTriggerRollover; } /** @@ -1153,18 +1385,6 @@ class RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -1221,18 +1441,6 @@ class RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -1391,6 +1599,107 @@ class RegisteredServers { } } + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + triggerRolloverWithHttpOperationResponse(resourceGroupName, storageSyncServiceName, serverId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, optionalCallback); + } + } + /** * Add a new registered server. * @@ -1404,18 +1713,6 @@ class RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -1472,18 +1769,6 @@ class RegisteredServers { * * @param {object} parameters Body of Registered Server object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverCertificate] Registered Server Certificate * * @param {string} [parameters.agentVersion] Registered Server Agent Version @@ -1642,6 +1927,107 @@ class RegisteredServers { } } + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginTriggerRolloverWithHttpOperationResponse(resourceGroupName, storageSyncServiceName, serverId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginTriggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {string} serverId Server Id + * + * @param {object} parameters Body of Trigger Rollover request. + * + * @param {string} [parameters.certificateData] Certificate Data + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginTriggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginTriggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginTriggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, options, optionalCallback); + } + } + } module.exports = RegisteredServers; diff --git a/lib/services/storagesyncManagement/lib/operations/serverEndpoints.js b/lib/services/storagesyncManagement/lib/operations/serverEndpoints.js index bfd557dcc1..fd0a566b95 100644 --- a/lib/services/storagesyncManagement/lib/operations/serverEndpoints.js +++ b/lib/services/storagesyncManagement/lib/operations/serverEndpoints.js @@ -30,18 +30,6 @@ const WebResource = msRest.WebResource; * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -50,6 +38,9 @@ const WebResource = msRest.WebResource; * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -143,15 +134,15 @@ function _create(resourceGroupName, storageSyncServiceName, syncGroupName, serve * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -745,18 +736,6 @@ function _recallAction(resourceGroupName, storageSyncServiceName, syncGroupName, * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -765,6 +744,9 @@ function _recallAction(resourceGroupName, storageSyncServiceName, syncGroupName, * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -977,15 +959,15 @@ function _beginCreate(resourceGroupName, storageSyncServiceName, syncGroupName, * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1566,18 +1548,6 @@ class ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -1586,6 +1556,9 @@ class ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -1630,18 +1603,6 @@ class ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -1650,6 +1611,9 @@ class ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -1719,15 +1683,15 @@ class ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1769,15 +1733,15 @@ class ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2236,18 +2200,6 @@ class ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -2256,6 +2208,9 @@ class ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -2300,18 +2255,6 @@ class ServerEndpoints { * * @param {object} parameters Body of Server Endpoint object. * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {string} [parameters.serverLocalPath] Server Local path. * * @param {string} [parameters.cloudTiering] Cloud Tiering. Possible values @@ -2320,6 +2263,9 @@ class ServerEndpoints { * @param {number} [parameters.volumeFreeSpacePercent] Level of free space to * be maintained by Cloud Tiering if it is enabled. * + * @param {number} [parameters.tierFilesOlderThanDays] Tier files older than + * days. + * * @param {string} [parameters.friendlyName] Friendly Name * * @param {string} [parameters.serverResourceId] Server Resource Id. @@ -2389,15 +2335,15 @@ class ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2439,15 +2385,15 @@ class ServerEndpoints { * @param {object} [options.parameters] Any of the properties applicable in PUT * request. * - * @param {object} [options.parameters.tags] The user-specified tags associated - * with the server endpoint. - * * @param {string} [options.parameters.cloudTiering] Cloud Tiering. Possible * values include: 'on', 'off' * * @param {number} [options.parameters.volumeFreeSpacePercent] Level of free * space to be maintained by Cloud Tiering if it is enabled. * + * @param {number} [options.parameters.tierFilesOlderThanDays] Tier files older + * than days. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/storagesyncManagement/lib/operations/storageSyncServices.js b/lib/services/storagesyncManagement/lib/operations/storageSyncServices.js index 5c5928460b..eeddf3ea61 100644 --- a/lib/services/storagesyncManagement/lib/operations/storageSyncServices.js +++ b/lib/services/storagesyncManagement/lib/operations/storageSyncServices.js @@ -203,7 +203,7 @@ function _checkNameAvailability(locationName, parameters, options, callback) { * * @param {object} parameters Storage Sync Service resource name. * - * @param {string} [parameters.location] Required. Gets or sets the location of + * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a * resource cannot be changed once it is created, but if an identical geo @@ -215,6 +215,8 @@ function _checkNameAvailability(locationName, parameters, options, callback) { * for a resource. Each tag must have a key with a length no greater than 128 * characters and a value with a length no greater than 256 characters. * + * @param {object} [parameters.properties] + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1360,7 +1362,7 @@ class StorageSyncServices { * * @param {object} parameters Storage Sync Service resource name. * - * @param {string} [parameters.location] Required. Gets or sets the location of + * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a * resource cannot be changed once it is created, but if an identical geo @@ -1372,6 +1374,8 @@ class StorageSyncServices { * for a resource. Each tag must have a key with a length no greater than 128 * characters and a value with a length no greater than 256 characters. * + * @param {object} [parameters.properties] + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1408,7 +1412,7 @@ class StorageSyncServices { * * @param {object} parameters Storage Sync Service resource name. * - * @param {string} [parameters.location] Required. Gets or sets the location of + * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a * resource cannot be changed once it is created, but if an identical geo @@ -1420,6 +1424,8 @@ class StorageSyncServices { * for a resource. Each tag must have a key with a length no greater than 128 * characters and a value with a length no greater than 256 characters. * + * @param {object} [parameters.properties] + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/storagesyncManagement/lib/operations/syncGroups.js b/lib/services/storagesyncManagement/lib/operations/syncGroups.js index 0b52f356ef..2d1f8e34e7 100644 --- a/lib/services/storagesyncManagement/lib/operations/syncGroups.js +++ b/lib/services/storagesyncManagement/lib/operations/syncGroups.js @@ -201,18 +201,6 @@ function _listByStorageSyncService(resourceGroupName, storageSyncServiceName, op * * @param {object} parameters Sync Group Body * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {object} [parameters.properties] The parameters used to create the * sync group * @@ -861,18 +849,6 @@ class SyncGroups { * * @param {object} parameters Sync Group Body * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {object} [parameters.properties] The parameters used to create the * sync group * @@ -914,18 +890,6 @@ class SyncGroups { * * @param {object} parameters Sync Group Body * - * @param {string} [parameters.location] Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * * @param {object} [parameters.properties] The parameters used to create the * sync group * diff --git a/lib/services/storagesyncManagement/lib/operations/workflows.js b/lib/services/storagesyncManagement/lib/operations/workflows.js index 751e912dc8..3e2d71fc8b 100644 --- a/lib/services/storagesyncManagement/lib/operations/workflows.js +++ b/lib/services/storagesyncManagement/lib/operations/workflows.js @@ -14,6 +14,180 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +/** + * Get a Workflow List + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkflowArray} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByStorageSyncService(resourceGroupName, storageSyncServiceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.length < 1) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { + if (this.client.apiVersion.length < 1) + { + throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); + } + } + if (storageSyncServiceName === null || storageSyncServiceName === undefined || typeof storageSyncServiceName.valueOf() !== 'string') { + throw new Error('storageSyncServiceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{storageSyncServiceName}', encodeURIComponent(storageSyncServiceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['StorageSyncError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkflowArray']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Get Workflows resource * @@ -364,10 +538,101 @@ class Workflows { */ constructor(client) { this.client = client; + this._listByStorageSyncService = _listByStorageSyncService; this._get = _get; this._abort = _abort; } + /** + * Get a Workflow List + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByStorageSyncServiceWithHttpOperationResponse(resourceGroupName, storageSyncServiceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByStorageSyncService(resourceGroupName, storageSyncServiceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get a Workflow List + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} storageSyncServiceName Name of Storage Sync Service + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WorkflowArray} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkflowArray} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByStorageSyncService(resourceGroupName, storageSyncServiceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByStorageSyncService(resourceGroupName, storageSyncServiceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByStorageSyncService(resourceGroupName, storageSyncServiceName, options, optionalCallback); + } + } + /** * Get Workflows resource * diff --git a/lib/services/storagesyncManagement/lib/storageSyncManagementClient.js b/lib/services/storagesyncManagement/lib/storageSyncManagementClient.js index f7e9ce7798..bfa8a10595 100644 --- a/lib/services/storagesyncManagement/lib/storageSyncManagementClient.js +++ b/lib/services/storagesyncManagement/lib/storageSyncManagementClient.js @@ -50,7 +50,7 @@ class StorageSyncManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-04-02'; + this.apiVersion = '2018-07-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true;