Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Merge upstream #3

Merged
merged 2 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 33 additions & 24 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
| [`@azure/arm-visualstudio`]( sdk/visualstudio/arm-visualstudio/package.json )| [Readme](sdk/visualstudio/arm-visualstudio/README.md) | N/A | N/A |
| [`@azure/arm-webservices`]( sdk/machinelearning/arm-webservices/package.json )| [Readme](sdk/machinelearning/arm-webservices/README.md) | N/A | N/A |
| [`@azure/arm-workspaces`]( sdk/machinelearning/arm-workspaces/package.json )| [Readme](sdk/machinelearning/arm-workspaces/README.md) | N/A | N/A |
| [`@azure/arm-peering`]( sdk/peering/arm-peering/package.json )| [Readme](sdk/peering/arm-peering/README.md) | N/A | N/A |
| [`@azure/batch`]( sdk/batch/batch/package.json )| [Readme](sdk/batch/batch/README.md) | N/A | N/A |
| [`@azure/cognitiveservices-anomalydetector`]( sdk/cognitiveservices/cognitiveservices-anomalydetector/package.json )| [Readme](sdk/cognitiveservices/cognitiveservices-anomalydetector/README.md) | N/A | N/A |
| [`@azure/cognitiveservices-autosuggest`]( sdk/cognitiveservices/cognitiveservices-autosuggest/package.json )| [Readme](sdk/cognitiveservices/cognitiveservices-autosuggest/README.md) | N/A | N/A |
Expand Down
23 changes: 12 additions & 11 deletions sdk/core/core-http/lib/webResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { HttpOperationResponse } from "./httpOperationResponse";
import { OperationResponse } from "./operationResponse";
import { ProxySettings } from "./serviceClient";
import { AbortSignalLike } from "@azure/abort-controller";
import { SpanOptions } from "@azure/core-tracing";

export type HttpMethods =
| "GET"
Expand Down Expand Up @@ -86,7 +87,7 @@ export class WebResource {
/**
* Options used to create a span when tracing is enabled.
*/
spanOptions?: any;
spanOptions?: SpanOptions;

constructor(
url?: string,
Expand Down Expand Up @@ -174,9 +175,9 @@ export class WebResource {
if (validMethods.indexOf(options.method.toUpperCase()) === -1) {
throw new Error(
'The provided method "' +
options.method +
'" is invalid. Supported HTTP methods are: ' +
JSON.stringify(validMethods)
options.method +
'" is invalid. Supported HTTP methods are: ' +
JSON.stringify(validMethods)
);
}
}
Expand All @@ -203,7 +204,7 @@ export class WebResource {
`pathTemplate: ${pathTemplate} has been provided. Hence, options.pathParameters must also be provided.`
);
}
segments.forEach(function(item) {
segments.forEach(function (item) {
const pathParamName = item.slice(1, -1);
const pathParam = (pathParameters as { [key: string]: any })[pathParamName];
if (
Expand All @@ -214,9 +215,9 @@ export class WebResource {
const stringifiedPathParameters = JSON.stringify(pathParameters, undefined, 2);
throw new Error(
`pathTemplate: ${pathTemplate} contains the path parameter ${pathParamName}` +
` however, it is not present in parameters: ${stringifiedPathParameters}.` +
`The value of the path parameter can either be a "string" of the form { ${pathParamName}: "some sample value" } or ` +
`it can be an "object" of the form { "${pathParamName}": { value: "some sample value", skipUrlEncoding: true } }.`
` however, it is not present in parameters: ${stringifiedPathParameters}.` +
`The value of the path parameter can either be a "string" of the form { ${pathParamName}: "some sample value" } or ` +
`it can be an "object" of the form { "${pathParamName}": { value: "some sample value", skipUrlEncoding: true } }.`
);
}

Expand Down Expand Up @@ -247,8 +248,8 @@ export class WebResource {
if (typeof queryParameters !== "object") {
throw new Error(
`options.queryParameters must be of type object. It should be a JSON object ` +
`of "query-parameter-name" as the key and the "query-parameter-value" as the value. ` +
`The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.`
`of "query-parameter-name" as the key and the "query-parameter-value" as the value. ` +
`The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.`
);
}
// append question mark if it is not present in the url
Expand Down Expand Up @@ -511,7 +512,7 @@ export interface RequestOptionsBase {
/**
* Options used to create a span when tracing is enabled.
*/
spanOptions?: any;
spanOptions?: SpanOptions;

[key: string]: any;
}
Loading