public PSPrivateLinkService ToPsPrivateLinkService(PrivateLinkService privateLinkService) { var psPrivateLinkService = NetworkResourceManagerProfile.Mapper.Map <PSPrivateLinkService>(privateLinkService); psPrivateLinkService.Tag = TagsConversionHelper.CreateTagHashtable(privateLinkService.Tags); return(psPrivateLinkService); }
public virtual PrivateLinkServicesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string serviceName, PrivateLinkService parameters, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { throw new ArgumentNullException(nameof(resourceGroupName)); } if (serviceName == null) { throw new ArgumentNullException(nameof(serviceName)); } if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesClient.StartCreateOrUpdate"); scope.Start(); try { var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, serviceName, parameters, cancellationToken); return(new PrivateLinkServicesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, serviceName, parameters).Request, originalResponse)); } catch (Exception e) { scope.Failed(e); throw; } }
/// <summary> /// Creates or updates an private link service in the specified resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the private link service. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update private link service operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PrivateLinkService> BeginCreateOrUpdateAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates an private link service in the specified resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the private link service. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update private link service operation. /// </param> public static PrivateLinkService BeginCreateOrUpdate(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters) { return(operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters).GetAwaiter().GetResult()); }