@azure/arm-newrelicobservability 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/index.js +4065 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/accountsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/accountsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/accountsListSample.js +84 -0
- package/dist-esm/samples-dev/accountsListSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsCreateOrUpdateSample.js +77 -0
- package/dist-esm/samples-dev/monitorsCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsDeleteSample.js +58 -0
- package/dist-esm/samples-dev/monitorsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsGetMetricRulesSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsGetMetricRulesSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsGetMetricRulesSample.js +58 -0
- package/dist-esm/samples-dev/monitorsGetMetricRulesSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsGetMetricStatusSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsGetMetricStatusSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsGetMetricStatusSample.js +63 -0
- package/dist-esm/samples-dev/monitorsGetMetricStatusSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsGetSample.js +38 -0
- package/dist-esm/samples-dev/monitorsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsListAppServicesSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsListAppServicesSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsListAppServicesSample.js +91 -0
- package/dist-esm/samples-dev/monitorsListAppServicesSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsListByResourceGroupSample.js +51 -0
- package/dist-esm/samples-dev/monitorsListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsListBySubscriptionSample.js +50 -0
- package/dist-esm/samples-dev/monitorsListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsListHostsSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsListHostsSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsListHostsSample.js +92 -0
- package/dist-esm/samples-dev/monitorsListHostsSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsListMonitoredResourcesSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsListMonitoredResourcesSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsListMonitoredResourcesSample.js +84 -0
- package/dist-esm/samples-dev/monitorsListMonitoredResourcesSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsSwitchBillingSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsSwitchBillingSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsSwitchBillingSample.js +70 -0
- package/dist-esm/samples-dev/monitorsSwitchBillingSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsUpdateSample.js +72 -0
- package/dist-esm/samples-dev/monitorsUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/monitorsVMHostPayloadSample.d.ts +2 -0
- package/dist-esm/samples-dev/monitorsVMHostPayloadSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/monitorsVMHostPayloadSample.js +56 -0
- package/dist-esm/samples-dev/monitorsVMHostPayloadSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +82 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/organizationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/organizationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/organizationsListSample.js +84 -0
- package/dist-esm/samples-dev/organizationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/plansListSample.d.ts +2 -0
- package/dist-esm/samples-dev/plansListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/plansListSample.js +83 -0
- package/dist-esm/samples-dev/plansListSample.js.map +1 -0
- package/dist-esm/samples-dev/tagRulesCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/tagRulesCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tagRulesCreateOrUpdateSample.js +84 -0
- package/dist-esm/samples-dev/tagRulesCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/tagRulesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/tagRulesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tagRulesDeleteSample.js +58 -0
- package/dist-esm/samples-dev/tagRulesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/tagRulesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/tagRulesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tagRulesGetSample.js +58 -0
- package/dist-esm/samples-dev/tagRulesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/tagRulesListByNewRelicMonitorResourceSample.d.ts +2 -0
- package/dist-esm/samples-dev/tagRulesListByNewRelicMonitorResourceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tagRulesListByNewRelicMonitorResourceSample.js +84 -0
- package/dist-esm/samples-dev/tagRulesListByNewRelicMonitorResourceSample.js.map +1 -0
- package/dist-esm/samples-dev/tagRulesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/tagRulesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tagRulesUpdateSample.js +83 -0
- package/dist-esm/samples-dev/tagRulesUpdateSample.js.map +1 -0
- package/dist-esm/src/index.d.ts +6 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +13 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +11 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +21 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +1138 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +204 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +57 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +1525 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +24 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +185 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/newRelicObservability.d.ts +25 -0
- package/dist-esm/src/newRelicObservability.d.ts.map +1 -0
- package/dist-esm/src/newRelicObservability.js +105 -0
- package/dist-esm/src/newRelicObservability.js.map +1 -0
- package/dist-esm/src/operations/accounts.d.ts +36 -0
- package/dist-esm/src/operations/accounts.d.ts.map +1 -0
- package/dist-esm/src/operations/accounts.js +143 -0
- package/dist-esm/src/operations/accounts.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +7 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +14 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/monitors.d.ts +211 -0
- package/dist-esm/src/operations/monitors.d.ts.map +1 -0
- package/dist-esm/src/operations/monitors.js +993 -0
- package/dist-esm/src/operations/monitors.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +131 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/organizations.d.ts +36 -0
- package/dist-esm/src/operations/organizations.d.ts.map +1 -0
- package/dist-esm/src/operations/organizations.js +143 -0
- package/dist-esm/src/operations/organizations.js.map +1 -0
- package/dist-esm/src/operations/plans.d.ts +32 -0
- package/dist-esm/src/operations/plans.d.ts.map +1 -0
- package/dist-esm/src/operations/plans.js +139 -0
- package/dist-esm/src/operations/plans.js.map +1 -0
- package/dist-esm/src/operations/tagRules.d.ts +91 -0
- package/dist-esm/src/operations/tagRules.d.ts.map +1 -0
- package/dist-esm/src/operations/tagRules.js +392 -0
- package/dist-esm/src/operations/tagRules.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/accounts.d.ts +13 -0
- package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
- package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +7 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +14 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/monitors.d.ts +120 -0
- package/dist-esm/src/operationsInterfaces/monitors.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/monitors.js +9 -0
- package/dist-esm/src/operationsInterfaces/monitors.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/organizations.d.ts +13 -0
- package/dist-esm/src/operationsInterfaces/organizations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/organizations.js +9 -0
- package/dist-esm/src/operationsInterfaces/organizations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/plans.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/plans.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/plans.js +9 -0
- package/dist-esm/src/operationsInterfaces/plans.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/tagRules.d.ts +65 -0
- package/dist-esm/src/operationsInterfaces/tagRules.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/tagRules.js +9 -0
- package/dist-esm/src/operationsInterfaces/tagRules.js.map +1 -0
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/newrelicobservability_operations_test.spec.ts.d.ts +4 -0
- package/dist-esm/test/newrelicobservability_operations_test.spec.ts.d.ts.map +1 -0
- package/dist-esm/test/newrelicobservability_operations_test.spec.ts.js +69 -0
- package/dist-esm/test/newrelicobservability_operations_test.spec.ts.js.map +1 -0
- package/package.json +123 -0
- package/review/arm-newrelicobservability.api.md +903 -0
- package/rollup.config.js +122 -0
- package/src/index.ts +13 -0
- package/src/lroImpl.ts +42 -0
- package/src/models/index.ts +1302 -0
- package/src/models/mappers.ts +1636 -0
- package/src/models/parameters.ts +222 -0
- package/src/newRelicObservability.ts +164 -0
- package/src/operations/accounts.ts +177 -0
- package/src/operations/index.ts +14 -0
- package/src/operations/monitors.ts +1354 -0
- package/src/operations/operations.ts +149 -0
- package/src/operations/organizations.ts +177 -0
- package/src/operations/plans.ts +156 -0
- package/src/operations/tagRules.ts +552 -0
- package/src/operationsInterfaces/accounts.ts +26 -0
- package/src/operationsInterfaces/index.ts +14 -0
- package/src/operationsInterfaces/monitors.ts +231 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/organizations.ts +29 -0
- package/src/operationsInterfaces/plans.ts +22 -0
- package/src/operationsInterfaces/tagRules.ts +127 -0
- package/src/pagingHelper.ts +39 -0
- package/tsconfig.json +33 -0
- package/types/arm-newrelicobservability.d.ts +1551 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
11
|
+
import { Operations } from "../operationsInterfaces";
|
|
12
|
+
import * as coreClient from "@azure/core-client";
|
|
13
|
+
import * as Mappers from "../models/mappers";
|
|
14
|
+
import * as Parameters from "../models/parameters";
|
|
15
|
+
import { NewRelicObservability } from "../newRelicObservability";
|
|
16
|
+
import {
|
|
17
|
+
Operation,
|
|
18
|
+
OperationsListNextOptionalParams,
|
|
19
|
+
OperationsListOptionalParams,
|
|
20
|
+
OperationsListResponse,
|
|
21
|
+
OperationsListNextResponse
|
|
22
|
+
} from "../models";
|
|
23
|
+
|
|
24
|
+
/// <reference lib="esnext.asynciterable" />
|
|
25
|
+
/** Class containing Operations operations. */
|
|
26
|
+
export class OperationsImpl implements Operations {
|
|
27
|
+
private readonly client: NewRelicObservability;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initialize a new instance of the class Operations class.
|
|
31
|
+
* @param client Reference to the service client
|
|
32
|
+
*/
|
|
33
|
+
constructor(client: NewRelicObservability) {
|
|
34
|
+
this.client = client;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List the operations for the provider
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
public list(
|
|
42
|
+
options?: OperationsListOptionalParams
|
|
43
|
+
): PagedAsyncIterableIterator<Operation> {
|
|
44
|
+
const iter = this.listPagingAll(options);
|
|
45
|
+
return {
|
|
46
|
+
next() {
|
|
47
|
+
return iter.next();
|
|
48
|
+
},
|
|
49
|
+
[Symbol.asyncIterator]() {
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
byPage: (settings?: PageSettings) => {
|
|
53
|
+
if (settings?.maxPageSize) {
|
|
54
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
55
|
+
}
|
|
56
|
+
return this.listPagingPage(options, settings);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private async *listPagingPage(
|
|
62
|
+
options?: OperationsListOptionalParams,
|
|
63
|
+
settings?: PageSettings
|
|
64
|
+
): AsyncIterableIterator<Operation[]> {
|
|
65
|
+
let result: OperationsListResponse;
|
|
66
|
+
let continuationToken = settings?.continuationToken;
|
|
67
|
+
if (!continuationToken) {
|
|
68
|
+
result = await this._list(options);
|
|
69
|
+
let page = result.value || [];
|
|
70
|
+
continuationToken = result.nextLink;
|
|
71
|
+
setContinuationToken(page, continuationToken);
|
|
72
|
+
yield page;
|
|
73
|
+
}
|
|
74
|
+
while (continuationToken) {
|
|
75
|
+
result = await this._listNext(continuationToken, options);
|
|
76
|
+
continuationToken = result.nextLink;
|
|
77
|
+
let page = result.value || [];
|
|
78
|
+
setContinuationToken(page, continuationToken);
|
|
79
|
+
yield page;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private async *listPagingAll(
|
|
84
|
+
options?: OperationsListOptionalParams
|
|
85
|
+
): AsyncIterableIterator<Operation> {
|
|
86
|
+
for await (const page of this.listPagingPage(options)) {
|
|
87
|
+
yield* page;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* List the operations for the provider
|
|
93
|
+
* @param options The options parameters.
|
|
94
|
+
*/
|
|
95
|
+
private _list(
|
|
96
|
+
options?: OperationsListOptionalParams
|
|
97
|
+
): Promise<OperationsListResponse> {
|
|
98
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* ListNext
|
|
103
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
104
|
+
* @param options The options parameters.
|
|
105
|
+
*/
|
|
106
|
+
private _listNext(
|
|
107
|
+
nextLink: string,
|
|
108
|
+
options?: OperationsListNextOptionalParams
|
|
109
|
+
): Promise<OperationsListNextResponse> {
|
|
110
|
+
return this.client.sendOperationRequest(
|
|
111
|
+
{ nextLink, options },
|
|
112
|
+
listNextOperationSpec
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Operation Specifications
|
|
117
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
118
|
+
|
|
119
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
120
|
+
path: "/providers/NewRelic.Observability/operations",
|
|
121
|
+
httpMethod: "GET",
|
|
122
|
+
responses: {
|
|
123
|
+
200: {
|
|
124
|
+
bodyMapper: Mappers.OperationListResult
|
|
125
|
+
},
|
|
126
|
+
default: {
|
|
127
|
+
bodyMapper: Mappers.ErrorResponse
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
queryParameters: [Parameters.apiVersion],
|
|
131
|
+
urlParameters: [Parameters.$host],
|
|
132
|
+
headerParameters: [Parameters.accept],
|
|
133
|
+
serializer
|
|
134
|
+
};
|
|
135
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
136
|
+
path: "{nextLink}",
|
|
137
|
+
httpMethod: "GET",
|
|
138
|
+
responses: {
|
|
139
|
+
200: {
|
|
140
|
+
bodyMapper: Mappers.OperationListResult
|
|
141
|
+
},
|
|
142
|
+
default: {
|
|
143
|
+
bodyMapper: Mappers.ErrorResponse
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
147
|
+
headerParameters: [Parameters.accept],
|
|
148
|
+
serializer
|
|
149
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
11
|
+
import { Organizations } from "../operationsInterfaces";
|
|
12
|
+
import * as coreClient from "@azure/core-client";
|
|
13
|
+
import * as Mappers from "../models/mappers";
|
|
14
|
+
import * as Parameters from "../models/parameters";
|
|
15
|
+
import { NewRelicObservability } from "../newRelicObservability";
|
|
16
|
+
import {
|
|
17
|
+
OrganizationResource,
|
|
18
|
+
OrganizationsListNextOptionalParams,
|
|
19
|
+
OrganizationsListOptionalParams,
|
|
20
|
+
OrganizationsListOperationResponse,
|
|
21
|
+
OrganizationsListNextResponse
|
|
22
|
+
} from "../models";
|
|
23
|
+
|
|
24
|
+
/// <reference lib="esnext.asynciterable" />
|
|
25
|
+
/** Class containing Organizations operations. */
|
|
26
|
+
export class OrganizationsImpl implements Organizations {
|
|
27
|
+
private readonly client: NewRelicObservability;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initialize a new instance of the class Organizations class.
|
|
31
|
+
* @param client Reference to the service client
|
|
32
|
+
*/
|
|
33
|
+
constructor(client: NewRelicObservability) {
|
|
34
|
+
this.client = client;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List all the existing organizations
|
|
39
|
+
* @param userEmail User Email.
|
|
40
|
+
* @param location Location for NewRelic.
|
|
41
|
+
* @param options The options parameters.
|
|
42
|
+
*/
|
|
43
|
+
public list(
|
|
44
|
+
userEmail: string,
|
|
45
|
+
location: string,
|
|
46
|
+
options?: OrganizationsListOptionalParams
|
|
47
|
+
): PagedAsyncIterableIterator<OrganizationResource> {
|
|
48
|
+
const iter = this.listPagingAll(userEmail, location, options);
|
|
49
|
+
return {
|
|
50
|
+
next() {
|
|
51
|
+
return iter.next();
|
|
52
|
+
},
|
|
53
|
+
[Symbol.asyncIterator]() {
|
|
54
|
+
return this;
|
|
55
|
+
},
|
|
56
|
+
byPage: (settings?: PageSettings) => {
|
|
57
|
+
if (settings?.maxPageSize) {
|
|
58
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
59
|
+
}
|
|
60
|
+
return this.listPagingPage(userEmail, location, options, settings);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private async *listPagingPage(
|
|
66
|
+
userEmail: string,
|
|
67
|
+
location: string,
|
|
68
|
+
options?: OrganizationsListOptionalParams,
|
|
69
|
+
settings?: PageSettings
|
|
70
|
+
): AsyncIterableIterator<OrganizationResource[]> {
|
|
71
|
+
let result: OrganizationsListOperationResponse;
|
|
72
|
+
let continuationToken = settings?.continuationToken;
|
|
73
|
+
if (!continuationToken) {
|
|
74
|
+
result = await this._list(userEmail, location, options);
|
|
75
|
+
let page = result.value || [];
|
|
76
|
+
continuationToken = result.nextLink;
|
|
77
|
+
setContinuationToken(page, continuationToken);
|
|
78
|
+
yield page;
|
|
79
|
+
}
|
|
80
|
+
while (continuationToken) {
|
|
81
|
+
result = await this._listNext(continuationToken, options);
|
|
82
|
+
continuationToken = result.nextLink;
|
|
83
|
+
let page = result.value || [];
|
|
84
|
+
setContinuationToken(page, continuationToken);
|
|
85
|
+
yield page;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private async *listPagingAll(
|
|
90
|
+
userEmail: string,
|
|
91
|
+
location: string,
|
|
92
|
+
options?: OrganizationsListOptionalParams
|
|
93
|
+
): AsyncIterableIterator<OrganizationResource> {
|
|
94
|
+
for await (const page of this.listPagingPage(
|
|
95
|
+
userEmail,
|
|
96
|
+
location,
|
|
97
|
+
options
|
|
98
|
+
)) {
|
|
99
|
+
yield* page;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* List all the existing organizations
|
|
105
|
+
* @param userEmail User Email.
|
|
106
|
+
* @param location Location for NewRelic.
|
|
107
|
+
* @param options The options parameters.
|
|
108
|
+
*/
|
|
109
|
+
private _list(
|
|
110
|
+
userEmail: string,
|
|
111
|
+
location: string,
|
|
112
|
+
options?: OrganizationsListOptionalParams
|
|
113
|
+
): Promise<OrganizationsListOperationResponse> {
|
|
114
|
+
return this.client.sendOperationRequest(
|
|
115
|
+
{ userEmail, location, options },
|
|
116
|
+
listOperationSpec
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* ListNext
|
|
122
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
123
|
+
* @param options The options parameters.
|
|
124
|
+
*/
|
|
125
|
+
private _listNext(
|
|
126
|
+
nextLink: string,
|
|
127
|
+
options?: OrganizationsListNextOptionalParams
|
|
128
|
+
): Promise<OrganizationsListNextResponse> {
|
|
129
|
+
return this.client.sendOperationRequest(
|
|
130
|
+
{ nextLink, options },
|
|
131
|
+
listNextOperationSpec
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Operation Specifications
|
|
136
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
137
|
+
|
|
138
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
139
|
+
path:
|
|
140
|
+
"/subscriptions/{subscriptionId}/providers/NewRelic.Observability/organizations",
|
|
141
|
+
httpMethod: "GET",
|
|
142
|
+
responses: {
|
|
143
|
+
200: {
|
|
144
|
+
bodyMapper: Mappers.OrganizationsListResponse
|
|
145
|
+
},
|
|
146
|
+
default: {
|
|
147
|
+
bodyMapper: Mappers.ErrorResponse
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
queryParameters: [
|
|
151
|
+
Parameters.apiVersion,
|
|
152
|
+
Parameters.userEmail,
|
|
153
|
+
Parameters.location
|
|
154
|
+
],
|
|
155
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
156
|
+
headerParameters: [Parameters.accept],
|
|
157
|
+
serializer
|
|
158
|
+
};
|
|
159
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
160
|
+
path: "{nextLink}",
|
|
161
|
+
httpMethod: "GET",
|
|
162
|
+
responses: {
|
|
163
|
+
200: {
|
|
164
|
+
bodyMapper: Mappers.OrganizationsListResponse
|
|
165
|
+
},
|
|
166
|
+
default: {
|
|
167
|
+
bodyMapper: Mappers.ErrorResponse
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
urlParameters: [
|
|
171
|
+
Parameters.$host,
|
|
172
|
+
Parameters.nextLink,
|
|
173
|
+
Parameters.subscriptionId
|
|
174
|
+
],
|
|
175
|
+
headerParameters: [Parameters.accept],
|
|
176
|
+
serializer
|
|
177
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
11
|
+
import { Plans } from "../operationsInterfaces";
|
|
12
|
+
import * as coreClient from "@azure/core-client";
|
|
13
|
+
import * as Mappers from "../models/mappers";
|
|
14
|
+
import * as Parameters from "../models/parameters";
|
|
15
|
+
import { NewRelicObservability } from "../newRelicObservability";
|
|
16
|
+
import {
|
|
17
|
+
PlanDataResource,
|
|
18
|
+
PlansListNextOptionalParams,
|
|
19
|
+
PlansListOptionalParams,
|
|
20
|
+
PlansListResponse,
|
|
21
|
+
PlansListNextResponse
|
|
22
|
+
} from "../models";
|
|
23
|
+
|
|
24
|
+
/// <reference lib="esnext.asynciterable" />
|
|
25
|
+
/** Class containing Plans operations. */
|
|
26
|
+
export class PlansImpl implements Plans {
|
|
27
|
+
private readonly client: NewRelicObservability;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initialize a new instance of the class Plans class.
|
|
31
|
+
* @param client Reference to the service client
|
|
32
|
+
*/
|
|
33
|
+
constructor(client: NewRelicObservability) {
|
|
34
|
+
this.client = client;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List plans data
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
public list(
|
|
42
|
+
options?: PlansListOptionalParams
|
|
43
|
+
): PagedAsyncIterableIterator<PlanDataResource> {
|
|
44
|
+
const iter = this.listPagingAll(options);
|
|
45
|
+
return {
|
|
46
|
+
next() {
|
|
47
|
+
return iter.next();
|
|
48
|
+
},
|
|
49
|
+
[Symbol.asyncIterator]() {
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
byPage: (settings?: PageSettings) => {
|
|
53
|
+
if (settings?.maxPageSize) {
|
|
54
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
55
|
+
}
|
|
56
|
+
return this.listPagingPage(options, settings);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private async *listPagingPage(
|
|
62
|
+
options?: PlansListOptionalParams,
|
|
63
|
+
settings?: PageSettings
|
|
64
|
+
): AsyncIterableIterator<PlanDataResource[]> {
|
|
65
|
+
let result: PlansListResponse;
|
|
66
|
+
let continuationToken = settings?.continuationToken;
|
|
67
|
+
if (!continuationToken) {
|
|
68
|
+
result = await this._list(options);
|
|
69
|
+
let page = result.value || [];
|
|
70
|
+
continuationToken = result.nextLink;
|
|
71
|
+
setContinuationToken(page, continuationToken);
|
|
72
|
+
yield page;
|
|
73
|
+
}
|
|
74
|
+
while (continuationToken) {
|
|
75
|
+
result = await this._listNext(continuationToken, options);
|
|
76
|
+
continuationToken = result.nextLink;
|
|
77
|
+
let page = result.value || [];
|
|
78
|
+
setContinuationToken(page, continuationToken);
|
|
79
|
+
yield page;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private async *listPagingAll(
|
|
84
|
+
options?: PlansListOptionalParams
|
|
85
|
+
): AsyncIterableIterator<PlanDataResource> {
|
|
86
|
+
for await (const page of this.listPagingPage(options)) {
|
|
87
|
+
yield* page;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* List plans data
|
|
93
|
+
* @param options The options parameters.
|
|
94
|
+
*/
|
|
95
|
+
private _list(options?: PlansListOptionalParams): Promise<PlansListResponse> {
|
|
96
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* ListNext
|
|
101
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
102
|
+
* @param options The options parameters.
|
|
103
|
+
*/
|
|
104
|
+
private _listNext(
|
|
105
|
+
nextLink: string,
|
|
106
|
+
options?: PlansListNextOptionalParams
|
|
107
|
+
): Promise<PlansListNextResponse> {
|
|
108
|
+
return this.client.sendOperationRequest(
|
|
109
|
+
{ nextLink, options },
|
|
110
|
+
listNextOperationSpec
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Operation Specifications
|
|
115
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
116
|
+
|
|
117
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
118
|
+
path:
|
|
119
|
+
"/subscriptions/{subscriptionId}/providers/NewRelic.Observability/plans",
|
|
120
|
+
httpMethod: "GET",
|
|
121
|
+
responses: {
|
|
122
|
+
200: {
|
|
123
|
+
bodyMapper: Mappers.PlanDataListResponse
|
|
124
|
+
},
|
|
125
|
+
default: {
|
|
126
|
+
bodyMapper: Mappers.ErrorResponse
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
queryParameters: [
|
|
130
|
+
Parameters.apiVersion,
|
|
131
|
+
Parameters.accountId,
|
|
132
|
+
Parameters.organizationId
|
|
133
|
+
],
|
|
134
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
135
|
+
headerParameters: [Parameters.accept],
|
|
136
|
+
serializer
|
|
137
|
+
};
|
|
138
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
139
|
+
path: "{nextLink}",
|
|
140
|
+
httpMethod: "GET",
|
|
141
|
+
responses: {
|
|
142
|
+
200: {
|
|
143
|
+
bodyMapper: Mappers.PlanDataListResponse
|
|
144
|
+
},
|
|
145
|
+
default: {
|
|
146
|
+
bodyMapper: Mappers.ErrorResponse
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
urlParameters: [
|
|
150
|
+
Parameters.$host,
|
|
151
|
+
Parameters.nextLink,
|
|
152
|
+
Parameters.subscriptionId
|
|
153
|
+
],
|
|
154
|
+
headerParameters: [Parameters.accept],
|
|
155
|
+
serializer
|
|
156
|
+
};
|