@azure/arm-support 2.0.1 → 2.0.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,11 @@
1
1
  # Release History
2
2
 
3
+ ## 2.0.2 (2022-07-05)
4
+
5
+ **Features**
6
+
7
+ - Bug fix
8
+
3
9
  ## 2.0.1 (2022-05-05)
4
10
 
5
11
  **Features**
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Azure Service client library for JavaScript
1
+ # Azure MicrosoftSupport client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure MicrosoftSupport client.
4
4
 
5
5
  Microsoft Azure Support Resource Provider.
6
6
 
@@ -24,7 +24,7 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP
24
24
 
25
25
  ### Install the `@azure/arm-support` package
26
26
 
27
- Install the Azure Service client library for JavaScript with `npm`:
27
+ Install the Azure MicrosoftSupport client library for JavaScript with `npm`:
28
28
 
29
29
  ```bash
30
30
  npm install @azure/arm-support
@@ -32,8 +32,8 @@ npm install @azure/arm-support
32
32
 
33
33
  ### Create and authenticate a `MicrosoftSupport`
34
34
 
35
- To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate.
36
- You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal].
35
+ To create a client object to access the Azure MicrosoftSupport API, you will need the `endpoint` of your Azure MicrosoftSupport resource and a `credential`. The Azure MicrosoftSupport client can use Azure Active Directory credentials to authenticate.
36
+ You can find the endpoint for your Azure MicrosoftSupport resource in the [Azure Portal][azure_portal].
37
37
 
38
38
  You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
39
39
 
@@ -43,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
43
43
  npm install @azure/identity
44
44
  ```
45
45
 
46
- You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
46
+ You will also need to **register a new AAD application and grant access to Azure MicrosoftSupport** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
47
47
  Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
48
48
 
49
49
  For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
@@ -72,7 +72,7 @@ To use this client library in the browser, first you need to use a bundler. For
72
72
 
73
73
  ### MicrosoftSupport
74
74
 
75
- `MicrosoftSupport` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access.
75
+ `MicrosoftSupport` is the primary interface for developers using the Azure MicrosoftSupport client library. Explore the methods on this client object to understand the different features of the Azure MicrosoftSupport service that you can access.
76
76
 
77
77
  ## Troubleshooting
78
78
 
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
  var coreLro = require('@azure/core-lro');
9
9
 
10
10
  function _interopNamespace(e) {
@@ -38,33 +38,45 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
38
38
  /** Known values of {@link SeverityLevel} that the service accepts. */
39
39
  exports.KnownSeverityLevel = void 0;
40
40
  (function (KnownSeverityLevel) {
41
+ /** Minimal */
41
42
  KnownSeverityLevel["Minimal"] = "minimal";
43
+ /** Moderate */
42
44
  KnownSeverityLevel["Moderate"] = "moderate";
45
+ /** Critical */
43
46
  KnownSeverityLevel["Critical"] = "critical";
47
+ /** Highestcriticalimpact */
44
48
  KnownSeverityLevel["Highestcriticalimpact"] = "highestcriticalimpact";
45
49
  })(exports.KnownSeverityLevel || (exports.KnownSeverityLevel = {}));
46
50
  /** Known values of {@link PreferredContactMethod} that the service accepts. */
47
51
  exports.KnownPreferredContactMethod = void 0;
48
52
  (function (KnownPreferredContactMethod) {
53
+ /** Email */
49
54
  KnownPreferredContactMethod["Email"] = "email";
55
+ /** Phone */
50
56
  KnownPreferredContactMethod["Phone"] = "phone";
51
57
  })(exports.KnownPreferredContactMethod || (exports.KnownPreferredContactMethod = {}));
52
58
  /** Known values of {@link Status} that the service accepts. */
53
59
  exports.KnownStatus = void 0;
54
60
  (function (KnownStatus) {
61
+ /** Open */
55
62
  KnownStatus["Open"] = "open";
63
+ /** Closed */
56
64
  KnownStatus["Closed"] = "closed";
57
65
  })(exports.KnownStatus || (exports.KnownStatus = {}));
58
66
  /** Known values of {@link CommunicationType} that the service accepts. */
59
67
  exports.KnownCommunicationType = void 0;
60
68
  (function (KnownCommunicationType) {
69
+ /** Web */
61
70
  KnownCommunicationType["Web"] = "web";
71
+ /** Phone */
62
72
  KnownCommunicationType["Phone"] = "phone";
63
73
  })(exports.KnownCommunicationType || (exports.KnownCommunicationType = {}));
64
74
  /** Known values of {@link CommunicationDirection} that the service accepts. */
65
75
  exports.KnownCommunicationDirection = void 0;
66
76
  (function (KnownCommunicationDirection) {
77
+ /** Inbound */
67
78
  KnownCommunicationDirection["Inbound"] = "inbound";
79
+ /** Outbound */
68
80
  KnownCommunicationDirection["Outbound"] = "outbound";
69
81
  })(exports.KnownCommunicationDirection || (exports.KnownCommunicationDirection = {}));
70
82
 
@@ -2163,7 +2175,7 @@ class MicrosoftSupport extends coreClient__namespace.ServiceClient {
2163
2175
  requestContentType: "application/json; charset=utf-8",
2164
2176
  credential: credentials
2165
2177
  };
2166
- const packageDetails = `azsdk-js-arm-support/2.0.1`;
2178
+ const packageDetails = `azsdk-js-arm-support/2.0.2`;
2167
2179
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2168
2180
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2169
2181
  : `${packageDetails}`;
@@ -2200,6 +2212,34 @@ class MicrosoftSupport extends coreClient__namespace.ServiceClient {
2200
2212
  this.problemClassifications = new ProblemClassificationsImpl(this);
2201
2213
  this.supportTickets = new SupportTicketsImpl(this);
2202
2214
  this.communications = new CommunicationsImpl(this);
2215
+ this.addCustomApiVersionPolicy(options.apiVersion);
2216
+ }
2217
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2218
+ addCustomApiVersionPolicy(apiVersion) {
2219
+ if (!apiVersion) {
2220
+ return;
2221
+ }
2222
+ const apiVersionPolicy = {
2223
+ name: "CustomApiVersionPolicy",
2224
+ sendRequest(request, next) {
2225
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2226
+ const param = request.url.split("?");
2227
+ if (param.length > 1) {
2228
+ const newParams = param[1].split("&").map((item) => {
2229
+ if (item.indexOf("api-version") > -1) {
2230
+ return "api-version=" + apiVersion;
2231
+ }
2232
+ else {
2233
+ return item;
2234
+ }
2235
+ });
2236
+ request.url = param[0] + "?" + newParams.join("&");
2237
+ }
2238
+ return next(request);
2239
+ });
2240
+ }
2241
+ };
2242
+ this.pipeline.addPolicy(apiVersionPolicy);
2203
2243
  }
2204
2244
  }
2205
2245