Skip to content

Commit

Permalink
Merge remote-tracking branch 'Azure/master' into move_challenge_based…
Browse files Browse the repository at this point in the history
…_auth
  • Loading branch information
sadasant committed Sep 14, 2020
2 parents e86d4f7 + 2433e61 commit 548d148
Show file tree
Hide file tree
Showing 9 changed files with 1,812 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/monitor/monitor-opentelemetry-exporter/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ browser
coverage
# don't lint generated files
src/Declarations
src/generated
1 change: 1 addition & 0 deletions sdk/monitor/monitor-opentelemetry-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"types": "types/src/index.d.ts",
"scripts": {
"clean": "rimraf dist-esm types dist",
"build:autorest": "autorest ./swagger/README.md --typescript --v3",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:node": "tsc -p .",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as coreHttp from "@azure/core-http";
import * as Parameters from "./models/parameters";
import * as Mappers from "./models/mappers";
import { ApplicationInsightsClientContext } from "./applicationInsightsClientContext";
import {
ApplicationInsightsClientOptionalParams,
TelemetryItem,
ApplicationInsightsClientTrackResponse
} from "./models";

export class ApplicationInsightsClient extends ApplicationInsightsClientContext {
/**
* Initializes a new instance of the ApplicationInsightsClient class.
* @param options The parameter options
*/
constructor(options?: ApplicationInsightsClientOptionalParams) {
super(options);
}

/**
* This operation generates a model using an entire series, each point is detected with the same model.
* With this method, points before and after a certain point are used to determine whether it is an
* anomaly. The entire detection can give user an overall status of the time series.
* @param body Time series points and period if needed. Advanced model parameters can also be set in
* the request.
* @param options The options parameters.
*/
track(
body: TelemetryItem[],
options?: coreHttp.OperationOptions
): Promise<ApplicationInsightsClientTrackResponse> {
const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase(
options || {}
);
return this.sendOperationRequest(
{ body, options: operationOptions },
trackOperationSpec
) as Promise<ApplicationInsightsClientTrackResponse>;
}
}
// Operation Specifications

const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);

const trackOperationSpec: coreHttp.OperationSpec = {
path: "/track",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.TrackResponse
},
206: {
bodyMapper: Mappers.TrackResponse
},
400: {
bodyMapper: Mappers.TrackResponse
},
402: {
bodyMapper: Mappers.TrackResponse
},
429: {
bodyMapper: Mappers.TrackResponse
},
500: {
bodyMapper: Mappers.TrackResponse
},
503: {
bodyMapper: Mappers.TrackResponse
}
},
requestBody: Parameters.body,
urlParameters: [Parameters.host],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as coreHttp from "@azure/core-http";
import { ApplicationInsightsClientOptionalParams } from "./models";

const packageName = "@azure/monitor-opentelemetry-exporter";
const packageVersion = "1.0.0";

export class ApplicationInsightsClientContext extends coreHttp.ServiceClient {
host: string;

/**
* Initializes a new instance of the ApplicationInsightsClientContext class.
* @param options The parameter options
*/
constructor(options?: ApplicationInsightsClientOptionalParams) {
// Initializing default values for options
if (!options) {
options = {};
}

if (!options.userAgent) {
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(undefined, options);

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{Host}/v2";

// Assigning values to Constant parameters
this.host = options.host || "https://dc.services.visualstudio.com";
}
}
11 changes: 11 additions & 0 deletions sdk/monitor/monitor-opentelemetry-exporter/src/generated/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export * from "./models";
export { ApplicationInsightsClient } from "./applicationInsightsClient";
export { ApplicationInsightsClientContext } from "./applicationInsightsClientContext";
Loading

0 comments on commit 548d148

Please sign in to comment.