@azure/synapse-monitoring 1.0.0-alpha.20250620.1 → 1.0.0-alpha.20250721.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.
@@ -9,6 +9,8 @@ import * as coreClient from "@azure/core-client";
9
9
  import * as coreRestPipeline from "@azure/core-rest-pipeline";
10
10
  import { MonitoringImpl } from "./operations/index.js";
11
11
  export class MonitoringClient extends coreClient.ServiceClient {
12
+ endpoint;
13
+ apiVersion;
12
14
  /**
13
15
  * Initializes a new instance of the MonitoringClient class.
14
16
  * @param credentials - Subscription credentials which uniquely identify client subscription.
@@ -17,7 +19,6 @@ export class MonitoringClient extends coreClient.ServiceClient {
17
19
  * @param options - The parameter options
18
20
  */
19
21
  constructor(credentials, endpoint, options) {
20
- var _a, _b;
21
22
  if (credentials === undefined) {
22
23
  throw new Error("'credentials' cannot be null");
23
24
  }
@@ -39,11 +40,16 @@ export class MonitoringClient extends coreClient.ServiceClient {
39
40
  if (!options.credentialScopes) {
40
41
  options.credentialScopes = ["https://dev.azuresynapse.net/.default"];
41
42
  }
42
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
43
+ const optionsWithDefaults = {
44
+ ...defaults,
45
+ ...options,
46
+ userAgentOptions: {
43
47
  userAgentPrefix,
44
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
48
+ },
49
+ baseUri: options.endpoint ?? options.baseUri ?? "{endpoint}",
50
+ };
45
51
  super(optionsWithDefaults);
46
- if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
52
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
47
53
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
48
54
  const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName);
49
55
  if (!bearerTokenAuthenticationPolicyFound) {
@@ -90,5 +96,6 @@ export class MonitoringClient extends coreClient.ServiceClient {
90
96
  };
91
97
  this.pipeline.addPolicy(apiVersionPolicy);
92
98
  }
99
+ monitoring;
93
100
  }
94
101
  //# sourceMappingURL=monitoringClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAI5D;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,QAAgB,EAChB,OAAwC;;QAExC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAmC;YAC/C,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,0CAA0C,CAAC;QAClE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,IAAI,CAAC,OAAO,C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GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;gBAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
1
+ {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAC5D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,QAAgB,EAChB,OAAwC;QAExC,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AO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAa;CACxB","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
@@ -39,6 +39,7 @@ const getSqlJobQueryStringOperationSpec = {
39
39
  };
40
40
  /** Class containing Monitoring operations. */
41
41
  export class MonitoringImpl {
42
+ client;
42
43
  /**
43
44
  * Initialize a new instance of the class Monitoring class.
44
45
  * @param client - Reference to the service client
@@ -51,7 +52,7 @@ export class MonitoringImpl {
51
52
  * @param options - The options parameters.
52
53
  */
53
54
  async getSparkJobList(options) {
54
- return tracingClient.withSpan("MonitoringClient.getSparkJobList", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
55
+ return tracingClient.withSpan("MonitoringClient.getSparkJobList", options ?? {}, async (updatedOptions) => {
55
56
  return this.client.sendOperationRequest({ updatedOptions }, getSparkJobListOperationSpec);
56
57
  });
57
58
  }
@@ -60,7 +61,7 @@ export class MonitoringImpl {
60
61
  * @param options - The options parameters.
61
62
  */
62
63
  async getSqlJobQueryString(options) {
63
- return tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
64
+ return tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options ?? {}, async (updatedOptions) => {
64
65
  return this.client.sendOperationRequest({ updatedOptions }, getSqlJobQueryStringOperationSpec);
65
66
  });
66
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../../src/operations/monitoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,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AAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../../src/operations/monitoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO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EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
@@ -13,6 +13,8 @@ const coreClient = tslib_1.__importStar(require("@azure/core-client"));
13
13
  const coreRestPipeline = tslib_1.__importStar(require("@azure/core-rest-pipeline"));
14
14
  const index_js_1 = require("./operations/index.js");
15
15
  class MonitoringClient extends coreClient.ServiceClient {
16
+ endpoint;
17
+ apiVersion;
16
18
  /**
17
19
  * Initializes a new instance of the MonitoringClient class.
18
20
  * @param credentials - Subscription credentials which uniquely identify client subscription.
@@ -21,7 +23,6 @@ class MonitoringClient extends coreClient.ServiceClient {
21
23
  * @param options - The parameter options
22
24
  */
23
25
  constructor(credentials, endpoint, options) {
24
- var _a, _b;
25
26
  if (credentials === undefined) {
26
27
  throw new Error("'credentials' cannot be null");
27
28
  }
@@ -43,11 +44,16 @@ class MonitoringClient extends coreClient.ServiceClient {
43
44
  if (!options.credentialScopes) {
44
45
  options.credentialScopes = ["https://dev.azuresynapse.net/.default"];
45
46
  }
46
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
47
+ const optionsWithDefaults = {
48
+ ...defaults,
49
+ ...options,
50
+ userAgentOptions: {
47
51
  userAgentPrefix,
48
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
52
+ },
53
+ baseUri: options.endpoint ?? options.baseUri ?? "{endpoint}",
54
+ };
49
55
  super(optionsWithDefaults);
50
- if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
56
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
51
57
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
52
58
  const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName);
53
59
  if (!bearerTokenAuthenticationPolicyFound) {
@@ -94,6 +100,7 @@ class MonitoringClient extends coreClient.ServiceClient {
94
100
  };
95
101
  this.pipeline.addPolicy(apiVersionPolicy);
96
102
  }
103
+ monitoring;
97
104
  }
98
105
  exports.MonitoringClient = MonitoringClient;
99
106
  //# sourceMappingURL=monitoringClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD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AM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF;AA3GD,4CA2GC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
1
+ {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAG9D,oDAAuD;AAIvD,MAAa,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAC5D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,QAAgB,EAChB,OAAwC;QAExC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAmC;YAC/C,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,0CAA0C,CAAC;QAClE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE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corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
@@ -43,6 +43,7 @@ const getSqlJobQueryStringOperationSpec = {
43
43
  };
44
44
  /** Class containing Monitoring operations. */
45
45
  class MonitoringImpl {
46
+ client;
46
47
  /**
47
48
  * Initialize a new instance of the class Monitoring class.
48
49
  * @param client - Reference to the service client
@@ -55,7 +56,7 @@ class MonitoringImpl {
55
56
  * @param options - The options parameters.
56
57
  */
57
58
  async getSparkJobList(options) {
58
- return tracing_js_1.tracingClient.withSpan("MonitoringClient.getSparkJobList", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
59
+ return tracing_js_1.tracingClient.withSpan("MonitoringClient.getSparkJobList", options ?? {}, async (updatedOptions) => {
59
60
  return this.client.sendOperationRequest({ updatedOptions }, getSparkJobListOperationSpec);
60
61
  });
61
62
  }
@@ -64,7 +65,7 @@ class MonitoringImpl {
64
65
  * @param options - The options parameters.
65
66
  */
66
67
  async getSqlJobQueryString(options) {
67
- return tracing_js_1.tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
68
+ return tracing_js_1.tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options ?? {}, async (updatedOptions) => {
68
69
  return this.client.sendOperationRequest({ updatedOptions }, getSqlJobQueryStringOperationSpec);
69
70
  });
70
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../../src/operations/monitoring.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAStD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wBAAwB;SAC7C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AACF,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,2CAA2C;IACjD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;IAChG,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AAEF,8CAA8C;AAC9C,MAAa,cAAc;IAGzB;;;OAGG;IACH,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD;QAEjD,OAAO,0BAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,0BAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAhDD,wCAgDC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../../src/operations/monitoring.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAStD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wBAAwB;SAC7C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AACF,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,2CAA2C;IACjD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;IAChG,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AAEF,8CAA8C;AAC9C,MAAa,cAAc;IACR,MAAM,CAAmB;IAE1C;;;OAGG;IACH,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD;QAEjD,OAAO,0BAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,0BAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAhDD,wCAgDC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
@@ -1,11 +1,11 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.8"
9
- }
10
- ]
11
- }
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.52.8"
9
+ }
10
+ ]
11
+ }
@@ -9,6 +9,8 @@ import * as coreClient from "@azure/core-client";
9
9
  import * as coreRestPipeline from "@azure/core-rest-pipeline";
10
10
  import { MonitoringImpl } from "./operations/index.js";
11
11
  export class MonitoringClient extends coreClient.ServiceClient {
12
+ endpoint;
13
+ apiVersion;
12
14
  /**
13
15
  * Initializes a new instance of the MonitoringClient class.
14
16
  * @param credentials - Subscription credentials which uniquely identify client subscription.
@@ -17,7 +19,6 @@ export class MonitoringClient extends coreClient.ServiceClient {
17
19
  * @param options - The parameter options
18
20
  */
19
21
  constructor(credentials, endpoint, options) {
20
- var _a, _b;
21
22
  if (credentials === undefined) {
22
23
  throw new Error("'credentials' cannot be null");
23
24
  }
@@ -39,11 +40,16 @@ export class MonitoringClient extends coreClient.ServiceClient {
39
40
  if (!options.credentialScopes) {
40
41
  options.credentialScopes = ["https://dev.azuresynapse.net/.default"];
41
42
  }
42
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
43
+ const optionsWithDefaults = {
44
+ ...defaults,
45
+ ...options,
46
+ userAgentOptions: {
43
47
  userAgentPrefix,
44
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
48
+ },
49
+ baseUri: options.endpoint ?? options.baseUri ?? "{endpoint}",
50
+ };
45
51
  super(optionsWithDefaults);
46
- if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
52
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
47
53
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
48
54
  const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName);
49
55
  if (!bearerTokenAuthenticationPolicyFound) {
@@ -90,5 +96,6 @@ export class MonitoringClient extends coreClient.ServiceClient {
90
96
  };
91
97
  this.pipeline.addPolicy(apiVersionPolicy);
92
98
  }
99
+ monitoring;
93
100
  }
94
101
  //# sourceMappingURL=monitoringClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAI5D;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,QAAgB,EAChB,OAAwC;;QAExC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BA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E,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
1
+ {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAC5D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,QAAgB,EAChB,OAAwC;QAExC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAmC;YAC/C,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,0CAA0C,CAAC;QAClE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,IAAI,CAAC,OAA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IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;gBAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAa;CACxB","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
@@ -39,6 +39,7 @@ const getSqlJobQueryStringOperationSpec = {
39
39
  };
40
40
  /** Class containing Monitoring operations. */
41
41
  export class MonitoringImpl {
42
+ client;
42
43
  /**
43
44
  * Initialize a new instance of the class Monitoring class.
44
45
  * @param client - Reference to the service client
@@ -51,7 +52,7 @@ export class MonitoringImpl {
51
52
  * @param options - The options parameters.
52
53
  */
53
54
  async getSparkJobList(options) {
54
- return tracingClient.withSpan("MonitoringClient.getSparkJobList", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
55
+ return tracingClient.withSpan("MonitoringClient.getSparkJobList", options ?? {}, async (updatedOptions) => {
55
56
  return this.client.sendOperationRequest({ updatedOptions }, getSparkJobListOperationSpec);
56
57
  });
57
58
  }
@@ -60,7 +61,7 @@ export class MonitoringImpl {
60
61
  * @param options - The options parameters.
61
62
  */
62
63
  async getSqlJobQueryString(options) {
63
- return tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
64
+ return tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options ?? {}, async (updatedOptions) => {
64
65
  return this.client.sendOperationRequest({ updatedOptions }, getSqlJobQueryStringOperationSpec);
65
66
  });
66
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../../src/operations/monitoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAStD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wBAAwB;SAC7C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AACF,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,2CAA2C;IACjD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;IAChG,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AAEF,8CAA8C;AAC9C,MAAM,OAAO,cAAc;IAGzB;;;OAGG;IACH,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD;QAEjD,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../../src/operations/monitoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAStD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wBAAwB;SAC7C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AACF,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,2CAA2C;IACjD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;IAChG,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC;IACpE,UAAU;CACX,CAAC;AAEF,8CAA8C;AAC9C,MAAM,OAAO,cAAc;IACR,MAAM,CAAmB;IAE1C;;;OAGG;IACH,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD;QAEjD,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
@@ -9,6 +9,8 @@ import * as coreClient from "@azure/core-client";
9
9
  import * as coreRestPipeline from "@azure/core-rest-pipeline";
10
10
  import { MonitoringImpl } from "./operations/index.js";
11
11
  export class MonitoringClient extends coreClient.ServiceClient {
12
+ endpoint;
13
+ apiVersion;
12
14
  /**
13
15
  * Initializes a new instance of the MonitoringClient class.
14
16
  * @param credentials - Subscription credentials which uniquely identify client subscription.
@@ -17,7 +19,6 @@ export class MonitoringClient extends coreClient.ServiceClient {
17
19
  * @param options - The parameter options
18
20
  */
19
21
  constructor(credentials, endpoint, options) {
20
- var _a, _b;
21
22
  if (credentials === undefined) {
22
23
  throw new Error("'credentials' cannot be null");
23
24
  }
@@ -39,11 +40,16 @@ export class MonitoringClient extends coreClient.ServiceClient {
39
40
  if (!options.credentialScopes) {
40
41
  options.credentialScopes = ["https://dev.azuresynapse.net/.default"];
41
42
  }
42
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
43
+ const optionsWithDefaults = {
44
+ ...defaults,
45
+ ...options,
46
+ userAgentOptions: {
43
47
  userAgentPrefix,
44
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
48
+ },
49
+ baseUri: options.endpoint ?? options.baseUri ?? "{endpoint}",
50
+ };
45
51
  super(optionsWithDefaults);
46
- if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
52
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
47
53
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
48
54
  const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName);
49
55
  if (!bearerTokenAuthenticationPolicyFound) {
@@ -90,5 +96,6 @@ export class MonitoringClient extends coreClient.ServiceClient {
90
96
  };
91
97
  this.pipeline.addPolicy(apiVersionPolicy);
92
98
  }
99
+ monitoring;
93
100
  }
94
101
  //# sourceMappingURL=monitoringClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAI5D;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,QAAgB,EAChB,OAAwC;;QAExC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAmC;YAC/C,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,0CAA0C,CAAC;QAClE,MAAM,eAAe,GACn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AC,CAAC;IAC5C,CAAC;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
1
+ {"version":3,"file":"monitoringClient.js","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,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gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAa;CACxB","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { MonitoringImpl } from \"./operations/index.js\";\nimport type { Monitoring } from \"./operationsInterfaces/index.js\";\nimport type { MonitoringClientOptionalParams } from \"./models/index.js\";\n\nexport class MonitoringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the MonitoringClient class.\n * @param credentials - Subscription credentials which uniquely identify client subscription.\n * @param endpoint - The workspace development endpoint, for example\n * https://myworkspace.dev.azuresynapse.net.\n * @param options - The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n endpoint: string,\n options?: MonitoringClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MonitoringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-synapse-monitoring/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://dev.azuresynapse.net/.default\"];\n }\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-12-01\";\n this.monitoring = new MonitoringImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string): void {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n monitoring: Monitoring;\n}\n"]}
@@ -39,6 +39,7 @@ const getSqlJobQueryStringOperationSpec = {
39
39
  };
40
40
  /** Class containing Monitoring operations. */
41
41
  export class MonitoringImpl {
42
+ client;
42
43
  /**
43
44
  * Initialize a new instance of the class Monitoring class.
44
45
  * @param client - Reference to the service client
@@ -51,7 +52,7 @@ export class MonitoringImpl {
51
52
  * @param options - The options parameters.
52
53
  */
53
54
  async getSparkJobList(options) {
54
- return tracingClient.withSpan("MonitoringClient.getSparkJobList", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
55
+ return tracingClient.withSpan("MonitoringClient.getSparkJobList", options ?? {}, async (updatedOptions) => {
55
56
  return this.client.sendOperationRequest({ updatedOptions }, getSparkJobListOperationSpec);
56
57
  });
57
58
  }
@@ -60,7 +61,7 @@ export class MonitoringImpl {
60
61
  * @param options - The options parameters.
61
62
  */
62
63
  async getSqlJobQueryString(options) {
63
- return tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options !== null && options !== void 0 ? options : {}, async (updatedOptions) => {
64
+ return tracingClient.withSpan("MonitoringClient.getSqlJobQueryString", options ?? {}, async (updatedOptions) => {
64
65
  return this.client.sendOperationRequest({ updatedOptions }, getSqlJobQueryStringOperationSpec);
65
66
  });
66
67
  }
@@ -1 +1 @@
1
- {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Y,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD;QAEjD,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
1
+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C;;;OAGG;IACH,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD;QAEjD,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,4BAA4B,CACiB,CAAC;QAClD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,EAClB,iCAAiC,CACiB,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport type { Monitoring } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport type { MonitoringClient } from \"../monitoringClient.js\";\nimport type {\n MonitoringGetSparkJobListOptionalParams,\n MonitoringGetSparkJobListResponse,\n MonitoringGetSqlJobQueryStringOptionalParams,\n MonitoringGetSqlJobQueryStringResponse,\n} from \"../models/index.js\";\n\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSparkJobListOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/spark/Applications\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SparkJobListViewResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\nconst getSqlJobQueryStringOperationSpec: coreClient.OperationSpec = {\n path: \"/monitoring/workloadTypes/sql/querystring\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SqlQueryStringDataModel,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.orderby, Parameters.skip],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.xMsClientRequestId],\n serializer,\n};\n\n/** Class containing Monitoring operations. */\nexport class MonitoringImpl implements Monitoring {\n private readonly client: MonitoringClient;\n\n /**\n * Initialize a new instance of the class Monitoring class.\n * @param client - Reference to the service client\n */\n constructor(client: MonitoringClient) {\n this.client = client;\n }\n\n /**\n * Get list of spark applications for the workspace.\n * @param options - The options parameters.\n */\n async getSparkJobList(\n options?: MonitoringGetSparkJobListOptionalParams,\n ): Promise<MonitoringGetSparkJobListResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSparkJobList\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSparkJobListOperationSpec,\n ) as Promise<MonitoringGetSparkJobListResponse>;\n },\n );\n }\n\n /**\n * Get SQL OD/DW Query for the workspace.\n * @param options - The options parameters.\n */\n async getSqlJobQueryString(\n options?: MonitoringGetSqlJobQueryStringOptionalParams,\n ): Promise<MonitoringGetSqlJobQueryStringResponse> {\n return tracingClient.withSpan(\n \"MonitoringClient.getSqlJobQueryString\",\n options ?? {},\n async (updatedOptions) => {\n return this.client.sendOperationRequest(\n { updatedOptions },\n getSqlJobQueryStringOperationSpec,\n ) as Promise<MonitoringGetSqlJobQueryStringResponse>;\n },\n );\n }\n}\n"]}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/synapse/synapse-monitoring/README.md",
6
6
  "repository": "github:Azure/azure-sdk-for-js",
7
7
  "sdk-type": "client",
8
- "version": "1.0.0-alpha.20250620.1",
8
+ "version": "1.0.0-alpha.20250721.1",
9
9
  "dependencies": {
10
10
  "@azure/core-auth": "^1.9.0",
11
11
  "@azure/core-client": "^1.9.2",
@@ -71,7 +71,7 @@
71
71
  "autoPublish": true,
72
72
  "type": "module",
73
73
  "tshy": {
74
- "project": "./tsconfig.src.json",
74
+ "project": "../../../tsconfig.src.build.json",
75
75
  "exports": {
76
76
  "./package.json": "./package.json",
77
77
  ".": "./src/index.ts"