diff --git a/packages/@azure/arm-network/lib/models/hubVirtualNetworkConnectionsMappers.ts b/packages/@azure/arm-network/lib/models/hubVirtualNetworkConnectionsMappers.ts index 93eb349ebbfa..df418b3c9071 100644 --- a/packages/@azure/arm-network/lib/models/hubVirtualNetworkConnectionsMappers.ts +++ b/packages/@azure/arm-network/lib/models/hubVirtualNetworkConnectionsMappers.ts @@ -14,6 +14,7 @@ export { BaseResource, ErrorModel, ErrorDetails, + TagsObject, ListHubVirtualNetworkConnectionsResult, NetworkInterfaceTapConfiguration, VirtualNetworkTap, diff --git a/packages/@azure/arm-network/lib/models/index.ts b/packages/@azure/arm-network/lib/models/index.ts index 7e8f14091f36..17fe9e024b37 100644 --- a/packages/@azure/arm-network/lib/models/index.ts +++ b/packages/@azure/arm-network/lib/models/index.ts @@ -20874,6 +20874,44 @@ export type HubVirtualNetworkConnectionsGetResponse = HubVirtualNetworkConnectio }; }; +/** + * Contains response data for the createOrUpdate operation. + */ +export type HubVirtualNetworkConnectionsCreateOrUpdateResponse = HubVirtualNetworkConnection & { + /** + * 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: HubVirtualNetworkConnection; + }; +}; + +/** + * Contains response data for the updateTags operation. + */ +export type HubVirtualNetworkConnectionsUpdateTagsResponse = HubVirtualNetworkConnection & { + /** + * 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: HubVirtualNetworkConnection; + }; +}; + /** * Contains response data for the list operation. */ @@ -20893,6 +20931,44 @@ export type HubVirtualNetworkConnectionsListResponse = ListHubVirtualNetworkConn }; }; +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type HubVirtualNetworkConnectionsBeginCreateOrUpdateResponse = HubVirtualNetworkConnection & { + /** + * 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: HubVirtualNetworkConnection; + }; +}; + +/** + * Contains response data for the beginUpdateTags operation. + */ +export type HubVirtualNetworkConnectionsBeginUpdateTagsResponse = HubVirtualNetworkConnection & { + /** + * 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: HubVirtualNetworkConnection; + }; +}; + /** * Contains response data for the listNext operation. */ diff --git a/packages/@azure/arm-network/lib/operations/hubVirtualNetworkConnections.ts b/packages/@azure/arm-network/lib/operations/hubVirtualNetworkConnections.ts index 815d03844840..05ef5fc0cfb5 100644 --- a/packages/@azure/arm-network/lib/operations/hubVirtualNetworkConnections.ts +++ b/packages/@azure/arm-network/lib/operations/hubVirtualNetworkConnections.ts @@ -9,6 +9,7 @@ */ import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/hubVirtualNetworkConnectionsMappers"; import * as Parameters from "../models/parameters"; @@ -62,6 +63,37 @@ export class HubVirtualNetworkConnections { callback) as Promise; } + /** + * Creates a HubVirtualNetworkConnection resource if it doesn't exist. Updates the + * HubVirtualNetworkConnection if one exists. + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the parent Virtual Hub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update + * HubVirtualNetworkConnection. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.HubVirtualNetworkConnection, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,virtualHubName,connectionName,hubVirtualNetworkConnectionParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates HubVirtualNetworkConnection tags. + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the parent Virtual Hub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to update + * HubVirtualNetworkConnection tags. + * @param [options] The optional parameters + * @returns Promise + */ + updateTags(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.TagsObject, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdateTags(resourceGroupName,virtualHubName,connectionName,hubVirtualNetworkConnectionParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** * Retrieves the details of all HubVirtualNetworkConnections. * @param resourceGroupName The resource group name of the VirtualHub. @@ -94,6 +126,53 @@ export class HubVirtualNetworkConnections { callback) as Promise; } + /** + * Creates a HubVirtualNetworkConnection resource if it doesn't exist. Updates the + * HubVirtualNetworkConnection if one exists. + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the parent Virtual Hub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update + * HubVirtualNetworkConnection. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.HubVirtualNetworkConnection, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + virtualHubName, + connectionName, + hubVirtualNetworkConnectionParameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Updates HubVirtualNetworkConnection tags. + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the parent Virtual Hub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to update + * HubVirtualNetworkConnection tags. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdateTags(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.TagsObject, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + virtualHubName, + connectionName, + hubVirtualNetworkConnectionParameters, + options + }, + beginUpdateTagsOperationSpec, + options); + } + /** * Retrieves the details of all HubVirtualNetworkConnections. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -176,6 +255,78 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualHubName, + Parameters.connectionName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "hubVirtualNetworkConnectionParameters", + mapper: { + ...Mappers.HubVirtualNetworkConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HubVirtualNetworkConnection + }, + 201: { + bodyMapper: Mappers.HubVirtualNetworkConnection + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const beginUpdateTagsOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualHubName, + Parameters.connectionName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "hubVirtualNetworkConnectionParameters", + mapper: { + ...Mappers.TagsObject, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HubVirtualNetworkConnection + }, + 201: { + bodyMapper: Mappers.HubVirtualNetworkConnection + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com",