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 @@ -14,6 +14,7 @@ export {
BaseResource,
ErrorModel,
ErrorDetails,
TagsObject,
ListHubVirtualNetworkConnectionsResult,
NetworkInterfaceTapConfiguration,
VirtualNetworkTap,
Expand Down
76 changes: 76 additions & 0 deletions packages/@azure/arm-network/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -62,6 +63,37 @@ export class HubVirtualNetworkConnections {
callback) as Promise<Models.HubVirtualNetworkConnectionsGetResponse>;
}

/**
* 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<Models.HubVirtualNetworkConnectionsCreateOrUpdateResponse>
*/
createOrUpdate(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.HubVirtualNetworkConnection, options?: msRest.RequestOptionsBase): Promise<Models.HubVirtualNetworkConnectionsCreateOrUpdateResponse> {
return this.beginCreateOrUpdate(resourceGroupName,virtualHubName,connectionName,hubVirtualNetworkConnectionParameters,options)
.then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.HubVirtualNetworkConnectionsCreateOrUpdateResponse>;
}

/**
* 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<Models.HubVirtualNetworkConnectionsUpdateTagsResponse>
*/
updateTags(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.TagsObject, options?: msRest.RequestOptionsBase): Promise<Models.HubVirtualNetworkConnectionsUpdateTagsResponse> {
return this.beginUpdateTags(resourceGroupName,virtualHubName,connectionName,hubVirtualNetworkConnectionParameters,options)
.then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.HubVirtualNetworkConnectionsUpdateTagsResponse>;
}

/**
* Retrieves the details of all HubVirtualNetworkConnections.
* @param resourceGroupName The resource group name of the VirtualHub.
Expand Down Expand Up @@ -94,6 +126,53 @@ export class HubVirtualNetworkConnections {
callback) as Promise<Models.HubVirtualNetworkConnectionsListResponse>;
}

/**
* 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<msRestAzure.LROPoller>
*/
beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.HubVirtualNetworkConnection, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
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<msRestAzure.LROPoller>
*/
beginUpdateTags(resourceGroupName: string, virtualHubName: string, connectionName: string, hubVirtualNetworkConnectionParameters: Models.TagsObject, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
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.
Expand Down Expand Up @@ -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",
Expand Down