Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class MicrosoftDatadogClientContext extends msRestAzure.AzureServiceClien
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -51,10 +51,10 @@ export class MicrosoftDatadogClientContext extends msRestAzure.AzureServiceClien
this.credentials = credentials;
this.subscriptionId = subscriptionId;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
28 changes: 28 additions & 0 deletions sdk/datadog/arm-datadog/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ export interface DatadogMonitorResourceUpdateParameters {
* The new tags of the monitor resource.
*/
tags?: { [propertyName: string]: string };
sku?: ResourceSku;
}

/**
Expand Down Expand Up @@ -680,6 +681,13 @@ export interface MonitorsBeginCreateOptionalParams extends msRest.RequestOptions
body?: DatadogMonitorResource;
}

/**
* Optional Parameters.
*/
export interface MonitorsBeginUpdateOptionalParams extends msRest.RequestOptionsBase {
body?: DatadogMonitorResourceUpdateParameters;
}

/**
* Optional Parameters.
*/
Expand Down Expand Up @@ -1181,6 +1189,26 @@ export type MonitorsBeginCreateResponse = DatadogMonitorResource & {
};
};

/**
* Contains response data for the beginUpdate operation.
*/
export type MonitorsBeginUpdateResponse = DatadogMonitorResource & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;

/**
* The response body as parsed JSON or XML
*/
parsedBody: DatadogMonitorResource;
};
};

/**
* Contains response data for the listApiKeysNext operation.
*/
Expand Down
7 changes: 7 additions & 0 deletions sdk/datadog/arm-datadog/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,13 @@ export const DatadogMonitorResourceUpdateParameters: msRest.CompositeMapper = {
}
}
}
},
sku: {
serializedName: "sku",
type: {
name: "Composite",
className: "ResourceSku"
}
}
}
}
Expand Down
83 changes: 42 additions & 41 deletions sdk/datadog/arm-datadog/src/operations/monitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,29 +322,9 @@ export class Monitors {
* @param [options] The optional parameters
* @returns Promise<Models.MonitorsUpdateResponse>
*/
update(resourceGroupName: string, monitorName: string, options?: Models.MonitorsUpdateOptionalParams): Promise<Models.MonitorsUpdateResponse>;
/**
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param monitorName Monitor resource name
* @param callback The callback
*/
update(resourceGroupName: string, monitorName: string, callback: msRest.ServiceCallback<Models.DatadogMonitorResource>): void;
/**
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param monitorName Monitor resource name
* @param options The optional parameters
* @param callback The callback
*/
update(resourceGroupName: string, monitorName: string, options: Models.MonitorsUpdateOptionalParams, callback: msRest.ServiceCallback<Models.DatadogMonitorResource>): void;
update(resourceGroupName: string, monitorName: string, options?: Models.MonitorsUpdateOptionalParams | msRest.ServiceCallback<Models.DatadogMonitorResource>, callback?: msRest.ServiceCallback<Models.DatadogMonitorResource>): Promise<Models.MonitorsUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
monitorName,
options
},
updateOperationSpec,
callback) as Promise<Models.MonitorsUpdateResponse>;
update(resourceGroupName: string, monitorName: string, options?: Models.MonitorsUpdateOptionalParams): Promise<Models.MonitorsUpdateResponse> {
return this.beginUpdate(resourceGroupName,monitorName,options)
.then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.MonitorsUpdateResponse>;
}

/**
Expand Down Expand Up @@ -409,6 +389,24 @@ export class Monitors {
options);
}

/**
* @summary Update a monitor resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param monitorName Monitor resource name
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginUpdate(resourceGroupName: string, monitorName: string, options?: Models.MonitorsBeginUpdateOptionalParams): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
resourceGroupName,
monitorName,
options
},
beginUpdateOperationSpec,
options);
}

/**
* @summary Delete a monitor resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
Expand Down Expand Up @@ -826,9 +824,9 @@ const getOperationSpec: msRest.OperationSpec = {
serializer
};

const updateOperationSpec: msRest.OperationSpec = {
httpMethod: "PATCH",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}",
const refreshSetPasswordLinkOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Expand All @@ -840,16 +838,9 @@ const updateOperationSpec: msRest.OperationSpec = {
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: [
"options",
"body"
],
mapper: Mappers.DatadogMonitorResourceUpdateParameters
},
responses: {
200: {
bodyMapper: Mappers.DatadogMonitorResource
bodyMapper: Mappers.DatadogSetPasswordLink
},
default: {
bodyMapper: Mappers.ErrorResponse
Expand All @@ -858,9 +849,9 @@ const updateOperationSpec: msRest.OperationSpec = {
serializer
};

const refreshSetPasswordLinkOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink",
const beginCreateOperationSpec: msRest.OperationSpec = {
httpMethod: "PUT",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Expand All @@ -872,9 +863,19 @@ const refreshSetPasswordLinkOperationSpec: msRest.OperationSpec = {
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: [
"options",
"body"
],
mapper: Mappers.DatadogMonitorResource
},
responses: {
200: {
bodyMapper: Mappers.DatadogSetPasswordLink
bodyMapper: Mappers.DatadogMonitorResource
},
201: {
bodyMapper: Mappers.DatadogMonitorResource
},
default: {
bodyMapper: Mappers.ErrorResponse
Expand All @@ -883,8 +884,8 @@ const refreshSetPasswordLinkOperationSpec: msRest.OperationSpec = {
serializer
};

const beginCreateOperationSpec: msRest.OperationSpec = {
httpMethod: "PUT",
const beginUpdateOperationSpec: msRest.OperationSpec = {
httpMethod: "PATCH",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}",
urlParameters: [
Parameters.subscriptionId,
Expand All @@ -902,7 +903,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = {
"options",
"body"
],
mapper: Mappers.DatadogMonitorResource
mapper: Mappers.DatadogMonitorResourceUpdateParameters
},
responses: {
200: {
Expand Down