diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js index 043a8d66de..1c6add02b9 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js @@ -80,6 +80,8 @@ class ApplicationGatewayBackendHealthServer { * read-only string that changes whenever the resource is updated. * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of * service endpoints. + * @member {array} [ipConfiguration.subnet.serviceEndpointPolicies] An array + * of service endpoint policies. * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of * references to the network interface IP configurations using subnet. * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an @@ -170,6 +172,9 @@ class ApplicationGatewayBackendHealthServer { * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] * An array of service endpoints. * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] + * An array of service endpoint policies. + * @member {array} * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations * using subnet. @@ -239,9 +244,6 @@ class ApplicationGatewayBackendHealthServer { * @member {array} * [ipConfiguration.publicIPAddress.publicIPPrefix.publicIPAddresses] The * list of all referenced PublicIPAddresses - * @member {number} - * [ipConfiguration.publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} * [ipConfiguration.publicIPAddress.publicIPPrefix.resourceGuid] The resource * GUID property of the public IP prefix resource. diff --git a/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js b/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js index a10cdfccd3..2a3e7327a6 100644 --- a/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js @@ -67,6 +67,8 @@ class FrontendIPConfiguration extends models['SubResource'] { * @member {string} [subnet.routeTable.etag] Gets a unique read-only string * that changes whenever the resource is updated. * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.serviceEndpointPolicies] An array of service + * endpoint policies. * @member {array} [subnet.ipConfigurations] Gets an array of references to * the network interface IP configurations using subnet. * @member {array} [subnet.resourceNavigationLinks] Gets an array of @@ -145,6 +147,9 @@ class FrontendIPConfiguration extends models['SubResource'] { * updated. * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] * An array of service endpoints. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array + * of service endpoint policies. * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations * using subnet. @@ -207,8 +212,6 @@ class FrontendIPConfiguration extends models['SubResource'] { * Prefix * @member {array} [publicIPAddress.publicIPPrefix.publicIPAddresses] The * list of all referenced PublicIPAddresses - * @member {number} [publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} [publicIPAddress.publicIPPrefix.resourceGuid] The * resource GUID property of the public IP prefix resource. * @member {string} [publicIPAddress.publicIPPrefix.provisioningState] The diff --git a/lib/services/networkManagement2/lib/models/iPConfiguration.js b/lib/services/networkManagement2/lib/models/iPConfiguration.js index 8d95d41115..36a5d33030 100644 --- a/lib/services/networkManagement2/lib/models/iPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/iPConfiguration.js @@ -59,6 +59,8 @@ class IPConfiguration extends models['SubResource'] { * @member {string} [subnet.routeTable.etag] Gets a unique read-only string * that changes whenever the resource is updated. * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.serviceEndpointPolicies] An array of service + * endpoint policies. * @member {array} [subnet.ipConfigurations] Gets an array of references to * the network interface IP configurations using subnet. * @member {array} [subnet.resourceNavigationLinks] Gets an array of @@ -120,8 +122,6 @@ class IPConfiguration extends models['SubResource'] { * Prefix * @member {array} [publicIPAddress.publicIPPrefix.publicIPAddresses] The * list of all referenced PublicIPAddresses - * @member {number} [publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} [publicIPAddress.publicIPPrefix.resourceGuid] The * resource GUID property of the public IP prefix resource. * @member {string} [publicIPAddress.publicIPPrefix.provisioningState] The diff --git a/lib/services/networkManagement2/lib/models/inboundNatRule.js b/lib/services/networkManagement2/lib/models/inboundNatRule.js index 4613393f3e..bcf3ed16a1 100644 --- a/lib/services/networkManagement2/lib/models/inboundNatRule.js +++ b/lib/services/networkManagement2/lib/models/inboundNatRule.js @@ -89,6 +89,8 @@ class InboundNatRule extends models['SubResource'] { * unique read-only string that changes whenever the resource is updated. * @member {array} [backendIPConfiguration.subnet.serviceEndpoints] An array * of service endpoints. + * @member {array} [backendIPConfiguration.subnet.serviceEndpointPolicies] An + * array of service endpoint policies. * @member {array} [backendIPConfiguration.subnet.ipConfigurations] Gets an * array of references to the network interface IP configurations using * subnet. @@ -182,6 +184,9 @@ class InboundNatRule extends models['SubResource'] { * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] * An array of service endpoints. * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] + * An array of service endpoint policies. + * @member {array} * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations * using subnet. @@ -259,9 +264,6 @@ class InboundNatRule extends models['SubResource'] { * @member {array} * [backendIPConfiguration.publicIPAddress.publicIPPrefix.publicIPAddresses] * The list of all referenced PublicIPAddresses - * @member {number} - * [backendIPConfiguration.publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] - * The idle timeout of the public IP prefix. * @member {string} * [backendIPConfiguration.publicIPAddress.publicIPPrefix.resourceGuid] The * resource GUID property of the public IP prefix resource. diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index f87da92cf2..fea69a23e7 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -338,6 +338,8 @@ export interface BackendAddressPool extends SubResource { * unique read-only string that changes whenever the resource is updated. * @member {array} [backendIPConfiguration.subnet.serviceEndpoints] An array of * service endpoints. + * @member {array} [backendIPConfiguration.subnet.serviceEndpointPolicies] An + * array of service endpoint policies. * @member {array} [backendIPConfiguration.subnet.ipConfigurations] Gets an * array of references to the network interface IP configurations using subnet. * @member {array} [backendIPConfiguration.subnet.resourceNavigationLinks] Gets @@ -430,6 +432,9 @@ export interface BackendAddressPool extends SubResource { * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] * An array of service endpoints. * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] + * An array of service endpoint policies. + * @member {array} * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations using * subnet. @@ -505,9 +510,6 @@ export interface BackendAddressPool extends SubResource { * @member {array} * [backendIPConfiguration.publicIPAddress.publicIPPrefix.publicIPAddresses] * The list of all referenced PublicIPAddresses - * @member {number} - * [backendIPConfiguration.publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] - * The idle timeout of the public IP prefix. * @member {string} * [backendIPConfiguration.publicIPAddress.publicIPPrefix.resourceGuid] The * resource GUID property of the public IP prefix resource. @@ -877,6 +879,55 @@ export interface ServiceEndpointPropertiesFormat { provisioningState?: string; } +/** + * @class + * Initializes a new instance of the ServiceEndpointPolicyDefinition class. + * @constructor + * Service Endpoint policy definitions. + * + * @member {string} [description] A description for this rule. Restricted to + * 140 chars. + * @member {string} [service] service endpoint name. + * @member {array} [serviceResources] A list of service resources. + * @member {string} [provisioningState] The provisioning state of the service + * end point policy definition. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ServiceEndpointPolicyDefinition extends SubResource { + description?: string; + service?: string; + serviceResources?: string[]; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceEndpointPolicy class. + * @constructor + * Service End point policy resource. + * + * @member {array} [serviceEndpointPolicyDefinitions] A collection of service + * endpoint policy definitions of the service endpoint policy. + * @member {string} [resourceGuid] The resource GUID property of the service + * endpoint policy resource. + * @member {string} [provisioningState] The provisioning state of the service + * endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ServiceEndpointPolicy extends Resource { + serviceEndpointPolicyDefinitions?: ServiceEndpointPolicyDefinition[]; + resourceGuid?: string; + provisioningState?: string; + etag?: string; +} + /** * @class * Initializes a new instance of the PublicIPAddressSku class. @@ -972,8 +1023,6 @@ export interface ReferencedPublicIpAddress { * @member {string} [ipPrefix] The allocated Prefix * @member {array} [publicIPAddresses] The list of all referenced * PublicIPAddresses - * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP - * prefix. * @member {string} [resourceGuid] The resource GUID property of the public IP * prefix resource. * @member {string} [provisioningState] The provisioning state of the Public IP @@ -990,7 +1039,6 @@ export interface PublicIPPrefix extends Resource { prefixLength?: number; ipPrefix?: string; publicIPAddresses?: ReferencedPublicIpAddress[]; - idleTimeoutInMinutes?: number; resourceGuid?: string; provisioningState?: string; etag?: string; @@ -1060,6 +1108,8 @@ export interface PublicIPPrefix extends Resource { * read-only string that changes whenever the resource is updated. * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of * service endpoints. + * @member {array} [ipConfiguration.subnet.serviceEndpointPolicies] An array of + * service endpoint policies. * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of * references to the network interface IP configurations using subnet. * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an @@ -1114,8 +1164,6 @@ export interface PublicIPPrefix extends Resource { * @member {string} [publicIPPrefix.ipPrefix] The allocated Prefix * @member {array} [publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses - * @member {number} [publicIPPrefix.idleTimeoutInMinutes] The idle timeout of - * the public IP prefix. * @member {string} [publicIPPrefix.resourceGuid] The resource GUID property of * the public IP prefix resource. * @member {string} [publicIPPrefix.provisioningState] The provisioning state @@ -1197,6 +1245,8 @@ export interface PublicIPAddress extends Resource { * @member {string} [subnet.routeTable.etag] Gets a unique read-only string * that changes whenever the resource is updated. * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.serviceEndpointPolicies] An array of service + * endpoint policies. * @member {array} [subnet.ipConfigurations] Gets an array of references to the * network interface IP configurations using subnet. * @member {array} [subnet.resourceNavigationLinks] Gets an array of references @@ -1256,8 +1306,6 @@ export interface PublicIPAddress extends Resource { * Prefix * @member {array} [publicIPAddress.publicIPPrefix.publicIPAddresses] The list * of all referenced PublicIPAddresses - * @member {number} [publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} [publicIPAddress.publicIPPrefix.resourceGuid] The resource * GUID property of the public IP prefix resource. * @member {string} [publicIPAddress.publicIPPrefix.provisioningState] The @@ -1356,6 +1404,8 @@ export interface ResourceNavigationLink extends SubResource { * @member {string} [routeTable.etag] Gets a unique read-only string that * changes whenever the resource is updated. * @member {array} [serviceEndpoints] An array of service endpoints. + * @member {array} [serviceEndpointPolicies] An array of service endpoint + * policies. * @member {array} [ipConfigurations] Gets an array of references to the * network interface IP configurations using subnet. * @member {array} [resourceNavigationLinks] Gets an array of references to the @@ -1371,6 +1421,7 @@ export interface Subnet extends SubResource { networkSecurityGroup?: NetworkSecurityGroup; routeTable?: RouteTable; serviceEndpoints?: ServiceEndpointPropertiesFormat[]; + serviceEndpointPolicies?: ServiceEndpointPolicy[]; readonly ipConfigurations?: IPConfiguration[]; resourceNavigationLinks?: ResourceNavigationLink[]; provisioningState?: string; @@ -1433,6 +1484,8 @@ export interface Subnet extends SubResource { * @member {string} [subnet.routeTable.etag] Gets a unique read-only string * that changes whenever the resource is updated. * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.serviceEndpointPolicies] An array of service + * endpoint policies. * @member {array} [subnet.ipConfigurations] Gets an array of references to the * network interface IP configurations using subnet. * @member {array} [subnet.resourceNavigationLinks] Gets an array of references @@ -1511,6 +1564,9 @@ export interface Subnet extends SubResource { * updated. * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An * array of service endpoints. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array of + * service endpoint policies. * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations using * subnet. @@ -1571,8 +1627,6 @@ export interface Subnet extends SubResource { * Prefix * @member {array} [publicIPAddress.publicIPPrefix.publicIPAddresses] The list * of all referenced PublicIPAddresses - * @member {number} [publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} [publicIPAddress.publicIPPrefix.resourceGuid] The resource * GUID property of the public IP prefix resource. * @member {string} [publicIPAddress.publicIPPrefix.provisioningState] The @@ -1807,6 +1861,8 @@ export interface ApplicationGatewayBackendHttpSettings extends SubResource { * read-only string that changes whenever the resource is updated. * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of * service endpoints. + * @member {array} [ipConfiguration.subnet.serviceEndpointPolicies] An array of + * service endpoint policies. * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of * references to the network interface IP configurations using subnet. * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an @@ -1896,6 +1952,9 @@ export interface ApplicationGatewayBackendHttpSettings extends SubResource { * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An * array of service endpoints. * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] + * An array of service endpoint policies. + * @member {array} * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations using * subnet. @@ -1965,9 +2024,6 @@ export interface ApplicationGatewayBackendHttpSettings extends SubResource { * @member {array} * [ipConfiguration.publicIPAddress.publicIPPrefix.publicIPAddresses] The list * of all referenced PublicIPAddresses - * @member {number} - * [ipConfiguration.publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} * [ipConfiguration.publicIPAddress.publicIPPrefix.resourceGuid] The resource * GUID property of the public IP prefix resource. @@ -3750,6 +3806,8 @@ export interface LoadBalancerSku { * @member {string} [subnet.routeTable.etag] Gets a unique read-only string * that changes whenever the resource is updated. * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.serviceEndpointPolicies] An array of service + * endpoint policies. * @member {array} [subnet.ipConfigurations] Gets an array of references to the * network interface IP configurations using subnet. * @member {array} [subnet.resourceNavigationLinks] Gets an array of references @@ -3825,6 +3883,9 @@ export interface LoadBalancerSku { * updated. * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An * array of service endpoints. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array of + * service endpoint policies. * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations using * subnet. @@ -3885,8 +3946,6 @@ export interface LoadBalancerSku { * Prefix * @member {array} [publicIPAddress.publicIPPrefix.publicIPAddresses] The list * of all referenced PublicIPAddresses - * @member {number} [publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} [publicIPAddress.publicIPPrefix.resourceGuid] The resource * GUID property of the public IP prefix resource. * @member {string} [publicIPAddress.publicIPPrefix.provisioningState] The @@ -7768,3 +7827,29 @@ export interface ListVpnGatewaysResult extends Array { export interface ListVpnConnectionsResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the ServiceEndpointPolicyListResult class. + * @constructor + * Response for ListServiceEndpointPolicies API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ServiceEndpointPolicyListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceEndpointPolicyDefinitionListResult class. + * @constructor + * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves + * all service endpoint policy definition that belongs to a service endpoint + * policy. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ServiceEndpointPolicyDefinitionListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index 30df4df2ef..2541c5b0f1 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -38,6 +38,8 @@ exports.NetworkSecurityGroup = require('./networkSecurityGroup'); exports.Route = require('./route'); exports.RouteTable = require('./routeTable'); exports.ServiceEndpointPropertiesFormat = require('./serviceEndpointPropertiesFormat'); +exports.ServiceEndpointPolicyDefinition = require('./serviceEndpointPolicyDefinition'); +exports.ServiceEndpointPolicy = require('./serviceEndpointPolicy'); exports.PublicIPAddressSku = require('./publicIPAddressSku'); exports.PublicIPAddressDnsSettings = require('./publicIPAddressDnsSettings'); exports.IpTag = require('./ipTag'); @@ -284,3 +286,5 @@ exports.ListVirtualHubsResult = require('./listVirtualHubsResult'); exports.ListHubVirtualNetworkConnectionsResult = require('./listHubVirtualNetworkConnectionsResult'); exports.ListVpnGatewaysResult = require('./listVpnGatewaysResult'); exports.ListVpnConnectionsResult = require('./listVpnConnectionsResult'); +exports.ServiceEndpointPolicyListResult = require('./serviceEndpointPolicyListResult'); +exports.ServiceEndpointPolicyDefinitionListResult = require('./serviceEndpointPolicyDefinitionListResult'); diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js b/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js index 8d480789bd..7cbe6d4c94 100644 --- a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js @@ -69,6 +69,8 @@ class NetworkInterfaceIPConfiguration extends models['SubResource'] { * @member {string} [subnet.routeTable.etag] Gets a unique read-only string * that changes whenever the resource is updated. * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.serviceEndpointPolicies] An array of service + * endpoint policies. * @member {array} [subnet.ipConfigurations] Gets an array of references to * the network interface IP configurations using subnet. * @member {array} [subnet.resourceNavigationLinks] Gets an array of @@ -149,6 +151,9 @@ class NetworkInterfaceIPConfiguration extends models['SubResource'] { * updated. * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] * An array of service endpoints. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array + * of service endpoint policies. * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] * Gets an array of references to the network interface IP configurations * using subnet. @@ -211,8 +216,6 @@ class NetworkInterfaceIPConfiguration extends models['SubResource'] { * Prefix * @member {array} [publicIPAddress.publicIPPrefix.publicIPAddresses] The * list of all referenced PublicIPAddresses - * @member {number} [publicIPAddress.publicIPPrefix.idleTimeoutInMinutes] The - * idle timeout of the public IP prefix. * @member {string} [publicIPAddress.publicIPPrefix.resourceGuid] The * resource GUID property of the public IP prefix resource. * @member {string} [publicIPAddress.publicIPPrefix.provisioningState] The diff --git a/lib/services/networkManagement2/lib/models/publicIPAddress.js b/lib/services/networkManagement2/lib/models/publicIPAddress.js index baf530a5ed..7e55e77baa 100644 --- a/lib/services/networkManagement2/lib/models/publicIPAddress.js +++ b/lib/services/networkManagement2/lib/models/publicIPAddress.js @@ -79,6 +79,8 @@ class PublicIPAddress extends models['Resource'] { * read-only string that changes whenever the resource is updated. * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of * service endpoints. + * @member {array} [ipConfiguration.subnet.serviceEndpointPolicies] An array + * of service endpoint policies. * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of * references to the network interface IP configurations using subnet. * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an @@ -134,8 +136,6 @@ class PublicIPAddress extends models['Resource'] { * @member {string} [publicIPPrefix.ipPrefix] The allocated Prefix * @member {array} [publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses - * @member {number} [publicIPPrefix.idleTimeoutInMinutes] The idle timeout of - * the public IP prefix. * @member {string} [publicIPPrefix.resourceGuid] The resource GUID property * of the public IP prefix resource. * @member {string} [publicIPPrefix.provisioningState] The provisioning state diff --git a/lib/services/networkManagement2/lib/models/publicIPPrefix.js b/lib/services/networkManagement2/lib/models/publicIPPrefix.js index 985fea0e19..15fa2711a9 100644 --- a/lib/services/networkManagement2/lib/models/publicIPPrefix.js +++ b/lib/services/networkManagement2/lib/models/publicIPPrefix.js @@ -32,8 +32,6 @@ class PublicIPPrefix extends models['Resource'] { * @member {string} [ipPrefix] The allocated Prefix * @member {array} [publicIPAddresses] The list of all referenced * PublicIPAddresses - * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP - * prefix. * @member {string} [resourceGuid] The resource GUID property of the public * IP prefix resource. * @member {string} [provisioningState] The provisioning state of the Public @@ -165,13 +163,6 @@ class PublicIPPrefix extends models['Resource'] { } } }, - idleTimeoutInMinutes: { - required: false, - serializedName: 'properties.idleTimeoutInMinutes', - type: { - name: 'Number' - } - }, resourceGuid: { required: false, serializedName: 'properties.resourceGuid', diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js new file mode 100644 index 0000000000..8851f22a7b --- /dev/null +++ b/lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Service End point policy resource. + * + * @extends models['Resource'] + */ +class ServiceEndpointPolicy extends models['Resource'] { + /** + * Create a ServiceEndpointPolicy. + * @member {array} [serviceEndpointPolicyDefinitions] A collection of service + * endpoint policy definitions of the service endpoint policy. + * @member {string} [resourceGuid] The resource GUID property of the service + * endpoint policy resource. + * @member {string} [provisioningState] The provisioning state of the service + * endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceEndpointPolicy + * + * @returns {object} metadata of ServiceEndpointPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceEndpointPolicy', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicy', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + serviceEndpointPolicyDefinitions: { + required: false, + serializedName: 'properties.serviceEndpointPolicyDefinitions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEndpointPolicyDefinitionElementType', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicyDefinition' + } + } + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceEndpointPolicy; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js new file mode 100644 index 0000000000..5fd6b74d31 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Service Endpoint policy definitions. + * + * @extends models['SubResource'] + */ +class ServiceEndpointPolicyDefinition extends models['SubResource'] { + /** + * Create a ServiceEndpointPolicyDefinition. + * @member {string} [description] A description for this rule. Restricted to + * 140 chars. + * @member {string} [service] service endpoint name. + * @member {array} [serviceResources] A list of service resources. + * @member {string} [provisioningState] The provisioning state of the service + * end point policy definition. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceEndpointPolicyDefinition + * + * @returns {object} metadata of ServiceEndpointPolicyDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceEndpointPolicyDefinition', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicyDefinition', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + service: { + required: false, + serializedName: 'properties.service', + type: { + name: 'String' + } + }, + serviceResources: { + required: false, + serializedName: 'properties.serviceResources', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceEndpointPolicyDefinition; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js new file mode 100644 index 0000000000..f79b5fd535 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves + * all service endpoint policy definition that belongs to a service endpoint + * policy. + */ +class ServiceEndpointPolicyDefinitionListResult extends Array { + /** + * Create a ServiceEndpointPolicyDefinitionListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceEndpointPolicyDefinitionListResult + * + * @returns {object} metadata of ServiceEndpointPolicyDefinitionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceEndpointPolicyDefinitionListResult', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicyDefinitionListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEndpointPolicyDefinitionElementType', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicyDefinition' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceEndpointPolicyDefinitionListResult; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js new file mode 100644 index 0000000000..ce785e4771 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListServiceEndpointPolicies API service call. + */ +class ServiceEndpointPolicyListResult extends Array { + /** + * Create a ServiceEndpointPolicyListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceEndpointPolicyListResult + * + * @returns {object} metadata of ServiceEndpointPolicyListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceEndpointPolicyListResult', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicyListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEndpointPolicyElementType', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicy' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceEndpointPolicyListResult; diff --git a/lib/services/networkManagement2/lib/models/subnet.js b/lib/services/networkManagement2/lib/models/subnet.js index 8ba2e0f670..96718bbd13 100644 --- a/lib/services/networkManagement2/lib/models/subnet.js +++ b/lib/services/networkManagement2/lib/models/subnet.js @@ -51,6 +51,8 @@ class Subnet extends models['SubResource'] { * @member {string} [routeTable.etag] Gets a unique read-only string that * changes whenever the resource is updated. * @member {array} [serviceEndpoints] An array of service endpoints. + * @member {array} [serviceEndpointPolicies] An array of service endpoint + * policies. * @member {array} [ipConfigurations] Gets an array of references to the * network interface IP configurations using subnet. * @member {array} [resourceNavigationLinks] Gets an array of references to @@ -125,6 +127,21 @@ class Subnet extends models['SubResource'] { } } }, + serviceEndpointPolicies: { + required: false, + serializedName: 'properties.serviceEndpointPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEndpointPolicyElementType', + type: { + name: 'Composite', + className: 'ServiceEndpointPolicy' + } + } + } + }, ipConfigurations: { required: false, readOnly: true, diff --git a/lib/services/networkManagement2/lib/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/networkManagementClient.d.ts index 871905401a..8e605e9d50 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ b/lib/services/networkManagement2/lib/networkManagementClient.d.ts @@ -104,6 +104,8 @@ export default class NetworkManagementClient extends AzureServiceClient { hubVirtualNetworkConnections: operations.HubVirtualNetworkConnections; vpnGateways: operations.VpnGateways; vpnConnections: operations.VpnConnections; + serviceEndpointPolicies: operations.ServiceEndpointPolicies; + serviceEndpointPolicyDefinitions: operations.ServiceEndpointPolicyDefinitions; /** diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index 7e2ee16d36..f4d05c202f 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -268,6 +268,8 @@ class NetworkManagementClient extends ServiceClient { this.hubVirtualNetworkConnections = new operations.HubVirtualNetworkConnections(this); this.vpnGateways = new operations.VpnGateways(this); this.vpnConnections = new operations.VpnConnections(this); + this.serviceEndpointPolicies = new operations.ServiceEndpointPolicies(this); + this.serviceEndpointPolicyDefinitions = new operations.ServiceEndpointPolicyDefinitions(this); this.models = models; this._checkDnsNameAvailability = _checkDnsNameAvailability; msRest.addSerializationMixin(this); diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index b2d2ce997e..248a29fc76 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -19992,9 +19992,6 @@ export interface PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -20120,9 +20117,6 @@ export interface PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -20723,9 +20717,6 @@ export interface PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -20851,9 +20842,6 @@ export interface PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -21392,9 +21380,6 @@ export interface PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -21457,9 +21442,6 @@ export interface PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -21776,9 +21758,6 @@ export interface PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -21841,9 +21820,6 @@ export interface PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -26309,6 +26285,9 @@ export interface Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -26404,6 +26383,9 @@ export interface Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -26639,6 +26621,9 @@ export interface Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -26734,6 +26719,9 @@ export interface Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -36711,3 +36699,1344 @@ export interface VpnConnections { listByVpnGatewayNext(nextPageLink: string, callback: ServiceCallback): void; listByVpnGatewayNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * ServiceEndpointPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ServiceEndpointPolicies { + + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serviceEndpointPolicyName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + update(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServiceEndpointPolicyDefinitions + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ServiceEndpointPolicyDefinitions { + + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified service endpoint policy definitions from service endpoint + * policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified service endpoint policy definitions from service endpoint + * policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinitionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, serviceEndpointPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceEndpointPolicyDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceEndpointPolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinitionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/networkManagement2/lib/operations/index.js b/lib/services/networkManagement2/lib/operations/index.js index 7298861dd7..72d46c9a6c 100644 --- a/lib/services/networkManagement2/lib/operations/index.js +++ b/lib/services/networkManagement2/lib/operations/index.js @@ -64,3 +64,5 @@ exports.VirtualHubs = require('./virtualHubs'); exports.HubVirtualNetworkConnections = require('./hubVirtualNetworkConnections'); exports.VpnGateways = require('./vpnGateways'); exports.VpnConnections = require('./vpnConnections'); +exports.ServiceEndpointPolicies = require('./serviceEndpointPolicies'); +exports.ServiceEndpointPolicyDefinitions = require('./serviceEndpointPolicyDefinitions'); diff --git a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js index 94a982b373..53dcea5bb7 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js @@ -301,9 +301,6 @@ function _get(resourceGroupName, publicIpAddressName, options, callback) { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -1451,9 +1448,6 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -2616,9 +2610,6 @@ class PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -2756,9 +2747,6 @@ class PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -3563,9 +3551,6 @@ class PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * @@ -3703,9 +3688,6 @@ class PublicIPAddresses { * @param {array} [parameters.publicIPPrefix.publicIPAddresses] The list of all * referenced PublicIPAddresses * - * @param {number} [parameters.publicIPPrefix.idleTimeoutInMinutes] The idle - * timeout of the public IP prefix. - * * @param {string} [parameters.publicIPPrefix.resourceGuid] The resource GUID * property of the public IP prefix resource. * diff --git a/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js b/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js index 494b8c1fca..63e1c12574 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js +++ b/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js @@ -260,9 +260,6 @@ function _get(resourceGroupName, publicIpPrefixName, options, callback) { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -860,9 +857,6 @@ function _beginDeleteMethod(resourceGroupName, publicIpPrefixName, options, call * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -1699,9 +1693,6 @@ class PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -1776,9 +1767,6 @@ class PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -2218,9 +2206,6 @@ class PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * @@ -2295,9 +2280,6 @@ class PublicIPPrefixes { * @param {array} [parameters.publicIPAddresses] The list of all referenced * PublicIPAddresses * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP prefix. - * * @param {string} [parameters.resourceGuid] The resource GUID property of the * public IP prefix resource. * diff --git a/lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js b/lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js new file mode 100644 index 0000000000..1080d40432 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js @@ -0,0 +1,2518 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serviceEndpointPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serviceEndpointPolicyName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all the service endpoint policies in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ServiceEndpointPolicy']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the service endpoint policies in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ServiceEndpointPolicies. */ +class ServiceEndpointPolicies { + /** + * Create a ServiceEndpointPolicies. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); + } + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); + } + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); + } + } + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); + } + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to the create or update + * service endpoint policy operation. + * + * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of + * service endpoint policy definitions of the service endpoint policy. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * service endpoint policy resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * service endpoint policy. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); + } + } + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {object} parameters Parameters supplied to update service endpoint + * policy tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ServiceEndpointPolicies; diff --git a/lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js b/lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js new file mode 100644 index 0000000000..4621ef341e --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js @@ -0,0 +1,1734 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Get the specified service endpoint policy definitions from service endpoint + * policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyDefinitionName === null || serviceEndpointPolicyDefinitionName === undefined || typeof serviceEndpointPolicyDefinitionName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinition/{serviceEndpointPolicyDefinitionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyDefinitionName}', encodeURIComponent(serviceEndpointPolicyDefinitionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinitionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyDefinitionName === null || serviceEndpointPolicyDefinitionName === undefined || typeof serviceEndpointPolicyDefinitionName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinition/{serviceEndpointPolicyDefinitionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyDefinitionName}', encodeURIComponent(serviceEndpointPolicyDefinitionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyDefinitionName === null || serviceEndpointPolicyDefinitionName === undefined || typeof serviceEndpointPolicyDefinitionName.valueOf() !== 'string') { + throw new Error('serviceEndpointPolicyDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (serviceEndpointPolicyDefinitions === null || serviceEndpointPolicyDefinitions === undefined) { + throw new Error('serviceEndpointPolicyDefinitions cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinition/{serviceEndpointPolicyDefinitionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); + requestUrl = requestUrl.replace('{serviceEndpointPolicyDefinitionName}', encodeURIComponent(serviceEndpointPolicyDefinitionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (serviceEndpointPolicyDefinitions !== null && serviceEndpointPolicyDefinitions !== undefined) { + let requestModelMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); + requestModel = client.serialize(requestModelMapper, serviceEndpointPolicyDefinitions, 'serviceEndpointPolicyDefinitions'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(serviceEndpointPolicyDefinitions, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinitionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceEndpointPolicyDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ServiceEndpointPolicyDefinitions. */ +class ServiceEndpointPolicyDefinitions { + /** + * Create a ServiceEndpointPolicyDefinitions. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._listByResourceGroup = _listByResourceGroup; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback); + } + } + + /** + * Get the specified service endpoint policy definitions from service endpoint + * policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint + * policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback); + } + } + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, optionalCallback); + } + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinitionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); + } + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the Service Endpoint + * Policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback); + } + } + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a service endpoint policy definition in the specified + * service endpoint policy. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} serviceEndpointPolicyName The name of the service endpoint + * policy. + * + * @param {string} serviceEndpointPolicyDefinitionName The name of the service + * endpoint policy definition name. + * + * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the + * create or update service endpoint policy operation. + * + * @param {string} [serviceEndpointPolicyDefinitions.description] A description + * for this rule. Restricted to 140 chars. + * + * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint + * name. + * + * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of + * service resources. + * + * @param {string} [serviceEndpointPolicyDefinitions.provisioningState] The + * provisioning state of the service end point policy definition. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinition} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, optionalCallback); + } + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceEndpointPolicyDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceEndpointPolicyDefinitionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ServiceEndpointPolicyDefinitions; diff --git a/lib/services/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js index f7003e46b0..a1af5e8771 100644 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ b/lib/services/networkManagement2/lib/operations/subnets.js @@ -305,6 +305,9 @@ function _get(resourceGroupName, virtualNetworkName, subnetName, options, callba * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -731,6 +734,9 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -1314,6 +1320,9 @@ class Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -1421,6 +1430,9 @@ class Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -1725,6 +1737,9 @@ class Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. * @@ -1832,6 +1847,9 @@ class Subnets { * @param {array} [subnetParameters.serviceEndpoints] An array of service * endpoints. * + * @param {array} [subnetParameters.serviceEndpointPolicies] An array of + * service endpoint policies. + * * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of * references to the external resources using subnet. *