internal static string ToSerializedValue(this SensitivityLabelSource value) { switch (value) { case SensitivityLabelSource.Current: return("current"); case SensitivityLabelSource.Recommended: return("recommended"); } return(null); }
public virtual Response <bool> Exists(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _serverDatabaseSchemaTableColumnSensitivityLabelSensitivityLabelsClientDiagnostics.CreateScope("ServerDatabaseSchemaTableColumnSensitivityLabelCollection.Exists"); scope.Start(); try { var response = GetIfExists(sensitivityLabelSource, cancellationToken: cancellationToken); return(Response.FromValue(response.Value != null, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <bool> Exists(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _managedInstanceDatabaseSchemaTableColumnSensitivityLabelManagedDatabaseSensitivityLabelsClientDiagnostics.CreateScope("ManagedInstanceDatabaseSchemaTableColumnSensitivityLabelCollection.Exists"); scope.Start(); try { var response = _managedInstanceDatabaseSchemaTableColumnSensitivityLabelManagedDatabaseSensitivityLabelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, sensitivityLabelSource, cancellationToken: cancellationToken); return(Response.FromValue(response.Value != null, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <bool> > ExistsAsync(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _serverDatabaseSchemaTableColumnSensitivityLabelSensitivityLabelsClientDiagnostics.CreateScope("ServerDatabaseSchemaTableColumnSensitivityLabelCollection.Exists"); scope.Start(); try { var response = await _serverDatabaseSchemaTableColumnSensitivityLabelSensitivityLabelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, sensitivityLabelSource, cancellationToken : cancellationToken).ConfigureAwait(false); return(Response.FromValue(response.Value != null, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <bool> > ExistsAsync(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _managedInstanceDatabaseSchemaTableColumnSensitivityLabelManagedDatabaseSensitivityLabelsClientDiagnostics.CreateScope("ManagedInstanceDatabaseSchemaTableColumnSensitivityLabelCollection.Exists"); scope.Start(); try { var response = await GetIfExistsAsync(sensitivityLabelSource, cancellationToken : cancellationToken).ConfigureAwait(false); return(Response.FromValue(response.Value != null, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <ServerDatabaseSchemaTableColumnSensitivityLabel> GetServerDatabaseSchemaTableColumnSensitivityLabel(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { return(GetServerDatabaseSchemaTableColumnSensitivityLabels().Get(sensitivityLabelSource, cancellationToken)); }
public virtual async Task <Response <ServerDatabaseSchemaTableColumnSensitivityLabel> > GetServerDatabaseSchemaTableColumnSensitivityLabelAsync(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { return(await GetServerDatabaseSchemaTableColumnSensitivityLabels().GetAsync(sensitivityLabelSource, cancellationToken).ConfigureAwait(false)); }
public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"; return(new ResourceIdentifier(resourceId)); }
public async virtual Task <Response <ManagedInstanceDatabaseSchemaTableColumnSensitivityLabel> > GetAsync(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _managedInstanceDatabaseSchemaTableColumnSensitivityLabelManagedDatabaseSensitivityLabelsClientDiagnostics.CreateScope("ManagedInstanceDatabaseSchemaTableColumnSensitivityLabel.Get"); scope.Start(); try { var response = await _managedInstanceDatabaseSchemaTableColumnSensitivityLabelManagedDatabaseSensitivityLabelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, sensitivityLabelSource, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _managedInstanceDatabaseSchemaTableColumnSensitivityLabelManagedDatabaseSensitivityLabelsClientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new ManagedInstanceDatabaseSchemaTableColumnSensitivityLabel(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
/// <summary> /// Gets the sensitivity label of a given column /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='databaseName'> /// The name of the database. /// </param> /// <param name='schemaName'> /// The name of the schema. /// </param> /// <param name='tableName'> /// The name of the table. /// </param> /// <param name='columnName'> /// The name of the column. /// </param> /// <param name='sensitivityLabelSource'> /// The source of the sensitivity label. Possible values include: 'current', /// 'recommended' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SensitivityLabel> GetAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the sensitivity label of a given column /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='databaseName'> /// The name of the database. /// </param> /// <param name='schemaName'> /// The name of the schema. /// </param> /// <param name='tableName'> /// The name of the table. /// </param> /// <param name='columnName'> /// The name of the column. /// </param> /// <param name='sensitivityLabelSource'> /// The source of the sensitivity label. Possible values include: 'current', /// 'recommended' /// </param> public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { return(operations.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult()); }
public static string ToSerialString(this SensitivityLabelSource value) => value switch {
/// <summary> /// Gets the sensitivity label of a given column /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='sqlPoolName'> /// SQL pool name /// </param> /// <param name='schemaName'> /// The name of the schema. /// </param> /// <param name='tableName'> /// The name of the table. /// </param> /// <param name='columnName'> /// The name of the column. /// </param> /// <param name='sensitivityLabelSource'> /// The source of the sensitivity label. Possible values include: 'current', /// 'recommended' /// </param> public static SensitivityLabel Get(this ISqlPoolSensitivityLabelsOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { return(operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult()); }
public virtual Response <ServerDatabaseSchemaTableColumnSensitivityLabel> GetIfExists(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _serverDatabaseSchemaTableColumnSensitivityLabelSensitivityLabelsClientDiagnostics.CreateScope("ServerDatabaseSchemaTableColumnSensitivityLabelCollection.GetIfExists"); scope.Start(); try { var response = _serverDatabaseSchemaTableColumnSensitivityLabelSensitivityLabelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, sensitivityLabelSource, cancellationToken: cancellationToken); if (response.Value == null) { return(Response.FromValue <ServerDatabaseSchemaTableColumnSensitivityLabel>(null, response.GetRawResponse())); } return(Response.FromValue(new ServerDatabaseSchemaTableColumnSensitivityLabel(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <SensitivityLabel> > GetAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SensitivityLabelsOperations.Get"); scope.Start(); try { return(await RestClient.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, cancellationToken).ConfigureAwait(false)); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <SensitivityLabel> Get(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ManagedDatabaseSensitivityLabelsOperations.Get"); scope.Start(); try { return(RestClient.Get(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, cancellationToken)); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <ManagedInstanceDatabaseSchemaTableColumnSensitivityLabelResource> GetManagedInstanceDatabaseSchemaTableColumnSensitivityLabel(SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default) { return(GetManagedInstanceDatabaseSchemaTableColumnSensitivityLabels().Get(sensitivityLabelSource, cancellationToken)); }