/// <summary>
 /// Creates Network Mapping.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.SiteRecovery.INetworkMappingOperations.
 /// </param>
 /// <param name='fabricName'>
 /// Required. Fabric Name.
 /// </param>
 /// <param name='primaryNetworkName'>
 /// Required. Primary Network Name.
 /// </param>
 /// <param name='networkMappingName'>
 /// Required. Network Mapping Name.
 /// </param>
 /// <param name='input'>
 /// Required. Network Mapping input.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static LongRunningOperationResponse BeginCreating(this INetworkMappingOperations operations, string fabricName, string primaryNetworkName, string networkMappingName, CreateNetworkMappingInput input, CustomRequestHeaders customRequestHeaders)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((INetworkMappingOperations)s).BeginCreatingAsync(fabricName, primaryNetworkName, networkMappingName, input, customRequestHeaders);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
        /// <summary>
        /// Creates a new Azure Site Recovery Network mapping.
        /// </summary>
        /// <param name="primaryFabricName">Primary fabric name</param>
        /// <param name="primaryNetworkName">Primary network name</param>
        /// <param name="mappingName">Mapping name</param>
        /// <param name="recoveryFabricName">Recovery fabric name</param>
        /// <param name="recoveryNetworkId">Recovery network id</param>
        /// <returns>Long running operation response</returns>
        public LongRunningOperationResponse NewAzureSiteRecoveryNetworkMapping(
            string primaryFabricName,
            string primaryNetworkName,
            string mappingName,
            string recoveryFabricName,
            string recoveryNetworkId)
        {
            CreateNetworkMappingInput input = new CreateNetworkMappingInput();
            input.RecoveryFabricName = recoveryFabricName;
            input.RecoveryNetworkId = recoveryNetworkId;

            return this.GetSiteRecoveryClient()
                .NetworkMapping
                .BeginCreating(
                primaryFabricName,
                primaryNetworkName,
                mappingName,
                input,
                this.GetRequestHeaders());
        }
 /// <summary>
 /// Creates Network Mapping.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.SiteRecovery.INetworkMappingOperations.
 /// </param>
 /// <param name='fabricName'>
 /// Required. Fabric Name.
 /// </param>
 /// <param name='primaryNetworkName'>
 /// Required. Primary Network Name.
 /// </param>
 /// <param name='networkMappingName'>
 /// Required. Network Mapping Name.
 /// </param>
 /// <param name='input'>
 /// Required. Network Mapping input.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static Task<LongRunningOperationResponse> BeginCreatingAsync(this INetworkMappingOperations operations, string fabricName, string primaryNetworkName, string networkMappingName, CreateNetworkMappingInput input, CustomRequestHeaders customRequestHeaders)
 {
     return operations.BeginCreatingAsync(fabricName, primaryNetworkName, networkMappingName, input, customRequestHeaders, CancellationToken.None);
 }