public virtual ArmOperation <EventHubClusterResource> Update(WaitUntil waitUntil, EventHubClusterData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); using var scope = _eventHubClusterClientDiagnostics.CreateScope("EventHubClusterResource.Update"); scope.Start(); try { var response = _eventHubClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); var operation = new EventHubsArmOperation <EventHubClusterResource>(new EventHubClusterOperationSource(Client), _eventHubClusterClientDiagnostics, Pipeline, _eventHubClusterRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <EventHubAuthorizationRuleResource> Update(WaitUntil waitUntil, AuthorizationRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); using var scope = _eventHubAuthorizationRuleEventHubsClientDiagnostics.CreateScope("EventHubAuthorizationRuleResource.Update"); scope.Start(); try { var response = _eventHubAuthorizationRuleEventHubsRestClient.CreateOrUpdateAuthorizationRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); var operation = new EventHubsArmOperation <EventHubAuthorizationRuleResource>(Response.FromValue(new EventHubAuthorizationRuleResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <NetworkRuleSet> CreateOrUpdate(WaitUntil waitUntil, NetworkRuleSetData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _networkRuleSetNamespacesClientDiagnostics.CreateScope("NetworkRuleSet.CreateOrUpdate"); scope.Start(); try { var response = _networkRuleSetNamespacesRestClient.CreateOrUpdateNetworkRuleSet(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, parameters, cancellationToken); var operation = new EventHubsArmOperation <NetworkRuleSet>(Response.FromValue(new NetworkRuleSet(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <SchemaGroup> CreateOrUpdate(WaitUntil waitUntil, string schemaGroupName, SchemaGroupData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(schemaGroupName, nameof(schemaGroupName)); Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _schemaGroupSchemaRegistryClientDiagnostics.CreateScope("SchemaGroupCollection.CreateOrUpdate"); scope.Start(); try { var response = _schemaGroupSchemaRegistryRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaGroupName, parameters, cancellationToken); var operation = new EventHubsArmOperation <SchemaGroup>(Response.FromValue(new SchemaGroup(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <PrivateEndpointConnectionResource> CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, PrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _privateEndpointConnectionClientDiagnostics.CreateScope("PrivateEndpointConnectionCollection.CreateOrUpdate"); scope.Start(); try { var response = _privateEndpointConnectionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); var operation = new EventHubsArmOperation <PrivateEndpointConnectionResource>(Response.FromValue(new PrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <NamespaceAuthorizationRule> CreateOrUpdate(bool waitForCompletion, string authorizationRuleName, AuthorizationRuleData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _namespaceAuthorizationRuleNamespacesClientDiagnostics.CreateScope("NamespaceAuthorizationRuleCollection.CreateOrUpdate"); scope.Start(); try { var response = _namespaceAuthorizationRuleNamespacesRestClient.CreateOrUpdateAuthorizationRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authorizationRuleName, parameters, cancellationToken); var operation = new EventHubsArmOperation <NamespaceAuthorizationRule>(Response.FromValue(new NamespaceAuthorizationRule(Client, response), response.GetRawResponse())); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <DisasterRecovery> CreateOrUpdate(bool waitForCompletion, string @alias, DisasterRecoveryData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _disasterRecoveryClientDiagnostics.CreateScope("DisasterRecoveryCollection.CreateOrUpdate"); scope.Start(); try { var response = _disasterRecoveryRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alias, parameters, cancellationToken); var operation = new EventHubsArmOperation <DisasterRecovery>(Response.FromValue(new DisasterRecovery(Client, response), response.GetRawResponse())); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <EventHubNamespace> CreateOrUpdate(bool waitForCompletion, string namespaceName, EventHubNamespaceData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _eventHubNamespaceClientDiagnostics.CreateScope("EventHubNamespaceCollection.CreateOrUpdate"); scope.Start(); try { var response = _eventHubNamespaceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, parameters, cancellationToken); var operation = new EventHubsArmOperation <EventHubNamespace>(new EventHubNamespaceOperationSource(Client), _eventHubNamespaceClientDiagnostics, Pipeline, _eventHubNamespaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, parameters).Request, response, OperationFinalStateVia.Location); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }