Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Generate azure-arm-storagesync package #5052

Merged
merged 3 commits into from Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions lib/services/storagesyncManagement/.scripts/postinstall.js
@@ -0,0 +1,41 @@
// 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.

const resetColor = "\x1b[0m";
const brightColor = "\x1b[1m";
const highlightColor = "\x1b[31m";

try {
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length;

const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-storagesync${resetColor}${brightColor} package.`;
const secondLine = "This package is in maintenance mode and will be deprecated in July 2019.";
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information.";

const framePadding = 4;
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength;
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding;
const getPaddingLength = (strLength) => width - strLength - framePadding;

const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength);
const secondLinePaddingLength = getPaddingLength(secondLine.length);
const thirdLinePaddingLength = getPaddingLength(thirdLine.length);
const line = "#".repeat(width);

const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`;

console.log(brightColor);
console.log("\n" + line);
console.log(formatTextLine(firstLine, firstLinePaddingLength));
console.log(formatTextLine(secondLine, secondLinePaddingLength));
console.log(formatTextLine(thirdLine, thirdLinePaddingLength));
console.log(line + "\n");
console.log(resetColor);
} catch (err) {
// ignore
}
2 changes: 1 addition & 1 deletion lib/services/storagesyncManagement/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 17 additions & 16 deletions lib/services/storagesyncManagement/README.md
Expand Up @@ -3,41 +3,42 @@ uid: azure-arm-storagesync
summary: *content

---
# Microsoft Azure SDK for Node.js - StorageSyncManagementClient
**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://www.npmjs.com/package/@azure/arm-storagesync) which works on Node.js and browsers.**
**See https://aka.ms/azure-sdk-for-js-migration to learn more.**
## Microsoft Azure SDK for Node.js - StorageSyncManagementClient

This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features
### Features


## How to Install
### How to Install

```bash
npm install azure-arm-storagesync
```

## How to use
### How to use

### Authentication, client creation and list operations as an example.
#### Authentication, client creation, and list operations as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const StorageSyncManagementClient = require("azure-arm-storagesync");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new StorageSyncManagementClient(creds, subscriptionId);
return client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
const subscriptionId = "<Subscription_Id>";
const client = new StorageSyncManagementClient(creds, subscriptionId);

return client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects
```
### Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FstoragesyncManagement%2FREADME.png)
Expand Up @@ -21,7 +21,7 @@ const models = require('./index');
class AzureEntityResource extends models['Resource'] {
/**
* Create a AzureEntityResource.
* @member {string} [etag] Resource Etag.
* @property {string} [etag] Resource Etag.
*/
constructor() {
super();
Expand Down
Expand Up @@ -17,7 +17,7 @@
class BackupRequest {
/**
* Create a BackupRequest.
* @member {string} [azureFileShare] Azure File Share.
* @property {string} [azureFileShare] Azure File Share.
*/
constructor() {
}
Expand Down
Expand Up @@ -17,7 +17,7 @@
class CheckNameAvailabilityParameters {
/**
* Create a CheckNameAvailabilityParameters.
* @member {string} name The name to check for availability
* @property {string} name The name to check for availability
*/
constructor() {
}
Expand Down
Expand Up @@ -17,14 +17,15 @@
class CheckNameAvailabilityResult {
/**
* Create a CheckNameAvailabilityResult.
* @member {boolean} [nameAvailable] Gets a boolean value that indicates
* @property {boolean} [nameAvailable] Gets a boolean value that indicates
* whether the name is available for you to use. If true, the name is
* available. If false, the name has already been taken or invalid and cannot
* be used.
* @member {string} [reason] Gets the reason that a Storage Sync Service name
* could not be used. The Reason element is only returned if NameAvailable is
* false. Possible values include: 'Invalid', 'AlreadyExists'
* @member {string} [message] Gets an error message explaining the Reason
* @property {string} [reason] Gets the reason that a Storage Sync Service
* name could not be used. The Reason element is only returned if
* NameAvailable is false. Possible values include: 'Invalid',
* 'AlreadyExists'
* @property {string} [message] Gets an error message explaining the Reason
* value in more detail.
*/
constructor() {
Expand Down
24 changes: 12 additions & 12 deletions lib/services/storagesyncManagement/lib/models/cloudEndpoint.js
Expand Up @@ -20,15 +20,15 @@ const models = require('./index');
class CloudEndpoint extends models['ProxyResource'] {
/**
* Create a CloudEndpoint.
* @member {string} [storageAccountResourceId] Storage Account Resource Id
* @member {string} [storageAccountShareName] Storage Account Share name
* @member {string} [storageAccountTenantId] Storage Account Tenant Id
* @member {string} [partnershipId] Partnership Id
* @member {string} [friendlyName] Friendly Name
* @member {boolean} [backupEnabled] Backup Enabled
* @member {string} [provisioningState] CloudEndpoint Provisioning State
* @member {string} [lastWorkflowId] CloudEndpoint lastWorkflowId
* @member {string} [lastOperationName] Resource Last Operation Name
* @property {string} [storageAccountResourceId] Storage Account Resource Id
* @property {string} [azureFileShareName] Azure file share name
* @property {string} [storageAccountTenantId] Storage Account Tenant Id
* @property {string} [partnershipId] Partnership Id
* @property {string} [friendlyName] Friendly Name
* @property {string} [backupEnabled] Backup Enabled
* @property {string} [provisioningState] CloudEndpoint Provisioning State
* @property {string} [lastWorkflowId] CloudEndpoint lastWorkflowId
* @property {string} [lastOperationName] Resource Last Operation Name
*/
constructor() {
super();
Expand Down Expand Up @@ -79,9 +79,9 @@ class CloudEndpoint extends models['ProxyResource'] {
name: 'String'
}
},
storageAccountShareName: {
azureFileShareName: {
required: false,
serializedName: 'properties.storageAccountShareName',
serializedName: 'properties.azureFileShareName',
type: {
name: 'String'
}
Expand Down Expand Up @@ -112,7 +112,7 @@ class CloudEndpoint extends models['ProxyResource'] {
readOnly: true,
serializedName: 'properties.backupEnabled',
type: {
name: 'Boolean'
name: 'String'
}
},
provisioningState: {
Expand Down
Expand Up @@ -20,9 +20,9 @@ const models = require('./index');
class CloudEndpointCreateParameters extends models['ProxyResource'] {
/**
* Create a CloudEndpointCreateParameters.
* @member {string} [storageAccountResourceId] Storage Account Resource Id
* @member {string} [storageAccountShareName] Storage Account Share name
* @member {string} [storageAccountTenantId] Storage Account Tenant Id
* @property {string} [storageAccountResourceId] Storage Account Resource Id
* @property {string} [azureFileShareName] Azure file share name
* @property {string} [storageAccountTenantId] Storage Account Tenant Id
*/
constructor() {
super();
Expand Down Expand Up @@ -73,9 +73,9 @@ class CloudEndpointCreateParameters extends models['ProxyResource'] {
name: 'String'
}
},
storageAccountShareName: {
azureFileShareName: {
required: false,
serializedName: 'properties.storageAccountShareName',
serializedName: 'properties.azureFileShareName',
type: {
name: 'String'
}
Expand Down
@@ -0,0 +1,73 @@
/*
* 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';

/**
* Files not syncing error object
*
*/
class FilesNotSyncingError {
/**
* Create a FilesNotSyncingError.
* @property {number} [errorCode] Error code (HResult)
* @property {number} [persistentCount] Count of persistent files not syncing
* with the specified error code
* @property {number} [transientCount] Count of transient files not syncing
* with the specified error code
*/
constructor() {
}

/**
* Defines the metadata of FilesNotSyncingError
*
* @returns {object} metadata of FilesNotSyncingError
*
*/
mapper() {
return {
required: false,
serializedName: 'FilesNotSyncingError',
type: {
name: 'Composite',
className: 'FilesNotSyncingError',
modelProperties: {
errorCode: {
required: false,
readOnly: true,
serializedName: 'errorCode',
type: {
name: 'Number'
}
},
persistentCount: {
required: false,
readOnly: true,
serializedName: 'persistentCount',
type: {
name: 'Number'
}
},
transientCount: {
required: false,
readOnly: true,
serializedName: 'transientCount',
type: {
name: 'Number'
}
}
}
}
};
}
}

module.exports = FilesNotSyncingError;