Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] billing/resource-manager #555

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions packages/@azure/arm-billing/.npmignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#git
.git
.gitignore
#gulp
gulpfile.js
#documentation
doc/
docs/
#dependencies
node_modules/
#samples
sample/
samples/
#tests
test/
tests/
coverage/
#tools and scripts
tools/
scripts/
#IDE settings
*.sln
.vscode/
.idea
.editorconfig
.ntvs_analysis.*
#build tools
.travis.yml
.jenkins.yml
.codeclimate.yml
appveyor.yml
# Nuget packages #
.nuget/
packages/
packages.config
#git
.git
.gitignore
#gulp
gulpfile.js
#documentation
doc/
docs/
#dependencies
node_modules/
#samples
sample/
samples/
#tests
test/
tests/
coverage/
#tools and scripts
tools/
scripts/
#IDE settings
*.sln
.vscode/
.idea
.editorconfig
.ntvs_analysis.*
#build tools
.travis.yml
.jenkins.yml
.codeclimate.yml
appveyor.yml
# Nuget packages #
.nuget/
packages/
packages.config
42 changes: 21 additions & 21 deletions packages/@azure/arm-billing/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2018 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
144 changes: 67 additions & 77 deletions packages/@azure/arm-billing/README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,67 @@
# Azure BillingManagementClient SDK for JavaScript
This package contains an isomorphic SDK for BillingManagementClient.

## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript

## How to Install
```
npm install @azure/arm-billing
```


## How to use

### nodejs - Authentication, client creation and list enrollmentAccounts as an example written in TypeScript.

```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { BillingManagementClient, BillingManagementModels, BillingManagementMappers } from "@azure/arm-billing";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new BillingManagementClient(creds, subscriptionId);
client.enrollmentAccounts.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

### browser - Authentication, client creation and list enrollmentAccounts as an example written in JavaScript.
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-billing sample</title>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-billing/dist/arm-billing.js"></script>
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmBilling.BillingManagementClient(res.creds, subscriptionId);
client.enrollmentAccounts.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error occurred:');
console.error(err);
});
});
</script>
</head>
<body>
</body>
</html>
```

# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Azure BillingManagementClient SDK for JavaScript
This package contains an isomorphic SDK for BillingManagementClient.

## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript

## How to Install
```
npm install @azure/arm-billing
```


## How to use

### nodejs - Authentication, client creation and list enrollmentAccounts as an example written in TypeScript.

```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { BillingManagementClient, BillingManagementModels, BillingManagementMappers } from "@azure/arm-billing";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new BillingManagementClient(creds, subscriptionId);
client.enrollmentAccounts.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

### browser - Authentication, client creation and list enrollmentAccounts as an example written in JavaScript.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-billing sample</title>
<script src="node_modules/ms-rest-js/master/msRestBundle.js"></script>
<script src="node_modules/ms-rest-azure-js/master/msRestAzureBundle.js"></script>
<script src="node_modules/@azure/arm-billing/billingManagementClientBundle.js"></script>
<script>
const subscriptionId = "<Subscription_Id>";
const token = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const client = new BillingManagementClient(creds, undefined, subscriptionId);
client.enrollmentAccounts.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error ocurred:');
console.error(err);
});
</script>
</head>
<body>
</body>
</html>
```

# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
84 changes: 2 additions & 82 deletions packages/@azure/arm-billing/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ import * as msRest from "ms-rest-js";
export { BaseResource, CloudError };


/**
* @interface
* An interface representing EnrollmentAccountProperties.
* The properties of the enrollment account.
*
*/
export interface EnrollmentAccountProperties {
/**
* @member {string} [principalName] The account owner's principal name.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly principalName?: string;
}

/**
* @interface
* An interface representing Resource.
Expand Down Expand Up @@ -73,35 +58,6 @@ export interface EnrollmentAccount extends Resource {
readonly principalName?: string;
}

/**
* @interface
* An interface representing BillingPeriodProperties.
* The properties of the billing period.
*
*/
export interface BillingPeriodProperties {
/**
* @member {Date} [billingPeriodStartDate] The start of the date range
* covered by the billing period.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly billingPeriodStartDate?: Date;
/**
* @member {Date} [billingPeriodEndDate] The end of the date range covered by
* the billing period.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly billingPeriodEndDate?: Date;
/**
* @member {string[]} [invoiceIds] Array of invoice ids that associated with.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly invoiceIds?: string[];
}

/**
* @interface
* An interface representing BillingPeriod.
Expand Down Expand Up @@ -197,42 +153,6 @@ export interface ErrorResponse {
error?: ErrorDetails;
}

/**
* @interface
* An interface representing InvoiceProperties.
* The properties of the invoice.
*
*/
export interface InvoiceProperties {
/**
* @member {DownloadUrl} [downloadUrl] A secure link to download the PDF
* version of an invoice. The link will cease to work after its expiry time
* is reached.
*/
downloadUrl?: DownloadUrl;
/**
* @member {Date} [invoicePeriodStartDate] The start of the date range
* covered by the invoice.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly invoicePeriodStartDate?: Date;
/**
* @member {Date} [invoicePeriodEndDate] The end of the date range covered by
* the invoice.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly invoicePeriodEndDate?: Date;
/**
* @member {string[]} [billingPeriodIds] Array of billing perdiod ids that
* the invoice is attributed to.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly billingPeriodIds?: string[];
}

/**
* @interface
* An interface representing Invoice.
Expand Down Expand Up @@ -262,8 +182,8 @@ export interface Invoice extends Resource {
*/
readonly invoicePeriodEndDate?: Date;
/**
* @member {string[]} [billingPeriodIds] Array of billing perdiod ids that
* the invoice is attributed to.
* @member {string[]} [billingPeriodIds] Array of billing period ids that the
* invoice is attributed to.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
Expand Down
Loading