@azure/arm-education 1.0.0-beta.1 → 1.0.0-beta.2

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ## 1.0.0-beta.2 (2022-07-04)
4
+
5
+ **Features**
6
+
7
+ - Added Interface GrantDetails
8
+ - Added Interface JoinRequestDetails
9
+ - Added Interface LabDetails
10
+ - Added Interface StudentDetails
11
+ - Added Interface StudentLabDetails
12
+ - Enum KnownLabStatus has a new value Pending
13
+
14
+
3
15
  ## 1.0.0-beta.1 (2022-05-24)
4
16
 
5
17
  The package of @azure/arm-education is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
package/README.md CHANGED
@@ -53,14 +53,15 @@ const { EducationManagementClient } = require("@azure/arm-education");
53
53
  const { DefaultAzureCredential } = require("@azure/identity");
54
54
  // For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
55
55
 
56
- const client = new EducationManagementClient(new DefaultAzureCredential());
56
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
57
+ const client = new EducationManagementClient(new DefaultAzureCredential(), subscriptionId);
57
58
 
58
59
  // For client-side applications running in the browser, use this code instead:
59
60
  // const credential = new InteractiveBrowserCredential({
60
61
  // tenantId: "<YOUR_TENANT_ID>",
61
62
  // clientId: "<YOUR_CLIENT_ID>"
62
63
  // });
63
- // const client = new EducationManagementClient(credential);
64
+ // const client = new EducationManagementClient(credential, subscriptionId);
64
65
  ```
65
66
 
66
67
 
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
 
9
9
  function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
@@ -37,60 +37,85 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
37
37
  /** Known values of {@link Origin} that the service accepts. */
38
38
  exports.KnownOrigin = void 0;
39
39
  (function (KnownOrigin) {
40
+ /** User */
40
41
  KnownOrigin["User"] = "user";
42
+ /** System */
41
43
  KnownOrigin["System"] = "system";
44
+ /** UserSystem */
42
45
  KnownOrigin["UserSystem"] = "user,system";
43
46
  })(exports.KnownOrigin || (exports.KnownOrigin = {}));
44
47
  /** Known values of {@link ActionType} that the service accepts. */
45
48
  exports.KnownActionType = void 0;
46
49
  (function (KnownActionType) {
50
+ /** Internal */
47
51
  KnownActionType["Internal"] = "Internal";
48
52
  })(exports.KnownActionType || (exports.KnownActionType = {}));
49
53
  /** Known values of {@link GrantType} that the service accepts. */
50
54
  exports.KnownGrantType = void 0;
51
55
  (function (KnownGrantType) {
56
+ /** Student */
52
57
  KnownGrantType["Student"] = "Student";
58
+ /** Academic */
53
59
  KnownGrantType["Academic"] = "Academic";
54
60
  })(exports.KnownGrantType || (exports.KnownGrantType = {}));
55
61
  /** Known values of {@link GrantStatus} that the service accepts. */
56
62
  exports.KnownGrantStatus = void 0;
57
63
  (function (KnownGrantStatus) {
64
+ /** Active */
58
65
  KnownGrantStatus["Active"] = "Active";
66
+ /** Inactive */
59
67
  KnownGrantStatus["Inactive"] = "Inactive";
60
68
  })(exports.KnownGrantStatus || (exports.KnownGrantStatus = {}));
61
69
  /** Known values of {@link CreatedByType} that the service accepts. */
62
70
  exports.KnownCreatedByType = void 0;
63
71
  (function (KnownCreatedByType) {
72
+ /** User */
64
73
  KnownCreatedByType["User"] = "User";
74
+ /** Application */
65
75
  KnownCreatedByType["Application"] = "Application";
76
+ /** ManagedIdentity */
66
77
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
78
+ /** Key */
67
79
  KnownCreatedByType["Key"] = "Key";
68
80
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
69
81
  /** Known values of {@link LabStatus} that the service accepts. */
70
82
  exports.KnownLabStatus = void 0;
71
83
  (function (KnownLabStatus) {
84
+ /** Active */
72
85
  KnownLabStatus["Active"] = "Active";
86
+ /** Deleted */
73
87
  KnownLabStatus["Deleted"] = "Deleted";
88
+ /** Pending */
89
+ KnownLabStatus["Pending"] = "Pending";
74
90
  })(exports.KnownLabStatus || (exports.KnownLabStatus = {}));
75
91
  /** Known values of {@link JoinRequestStatus} that the service accepts. */
76
92
  exports.KnownJoinRequestStatus = void 0;
77
93
  (function (KnownJoinRequestStatus) {
94
+ /** Pending */
78
95
  KnownJoinRequestStatus["Pending"] = "Pending";
96
+ /** Denied */
79
97
  KnownJoinRequestStatus["Denied"] = "Denied";
80
98
  })(exports.KnownJoinRequestStatus || (exports.KnownJoinRequestStatus = {}));
81
99
  /** Known values of {@link StudentRole} that the service accepts. */
82
100
  exports.KnownStudentRole = void 0;
83
101
  (function (KnownStudentRole) {
102
+ /** Student */
84
103
  KnownStudentRole["Student"] = "Student";
104
+ /** Admin */
85
105
  KnownStudentRole["Admin"] = "Admin";
86
106
  })(exports.KnownStudentRole || (exports.KnownStudentRole = {}));
87
107
  /** Known values of {@link StudentLabStatus} that the service accepts. */
88
108
  exports.KnownStudentLabStatus = void 0;
89
109
  (function (KnownStudentLabStatus) {
110
+ /** Active */
90
111
  KnownStudentLabStatus["Active"] = "Active";
112
+ /** Disabled */
91
113
  KnownStudentLabStatus["Disabled"] = "Disabled";
114
+ /** Expired */
92
115
  KnownStudentLabStatus["Expired"] = "Expired";
116
+ /** Pending */
93
117
  KnownStudentLabStatus["Pending"] = "Pending";
118
+ /** Deleted */
94
119
  KnownStudentLabStatus["Deleted"] = "Deleted";
95
120
  })(exports.KnownStudentLabStatus || (exports.KnownStudentLabStatus = {}));
96
121
 
@@ -2400,7 +2425,7 @@ class EducationManagementClient extends coreClient__namespace.ServiceClient {
2400
2425
  requestContentType: "application/json; charset=utf-8",
2401
2426
  credential: credentials
2402
2427
  };
2403
- const packageDetails = `azsdk-js-arm-education/1.0.0-beta.1`;
2428
+ const packageDetails = `azsdk-js-arm-education/1.0.0-beta.2`;
2404
2429
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2405
2430
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2406
2431
  : `${packageDetails}`;
@@ -2436,6 +2461,34 @@ class EducationManagementClient extends coreClient__namespace.ServiceClient {
2436
2461
  this.joinRequests = new JoinRequestsImpl(this);
2437
2462
  this.students = new StudentsImpl(this);
2438
2463
  this.studentLabs = new StudentLabsImpl(this);
2464
+ this.addCustomApiVersionPolicy(options.apiVersion);
2465
+ }
2466
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2467
+ addCustomApiVersionPolicy(apiVersion) {
2468
+ if (!apiVersion) {
2469
+ return;
2470
+ }
2471
+ const apiVersionPolicy = {
2472
+ name: "CustomApiVersionPolicy",
2473
+ sendRequest(request, next) {
2474
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2475
+ const param = request.url.split("?");
2476
+ if (param.length > 1) {
2477
+ const newParams = param[1].split("&").map((item) => {
2478
+ if (item.indexOf("api-version") > -1) {
2479
+ return "api-version=" + apiVersion;
2480
+ }
2481
+ else {
2482
+ return item;
2483
+ }
2484
+ });
2485
+ request.url = param[0] + "?" + newParams.join("&");
2486
+ }
2487
+ return next(request);
2488
+ });
2489
+ }
2490
+ };
2491
+ this.pipeline.addPolicy(apiVersionPolicy);
2439
2492
  }
2440
2493
  /**
2441
2494
  * Redeem invite code to join a redeemable lab