Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR sql/resource-manager] Add new APIs (two List APIs) and update examples #4442

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ public interface DatabaseBlobAuditingPolicies extends SupportsCreating<DatabaseB
*/
Observable<DatabaseBlobAuditingPolicy> getAsync(String resourceGroupName, String serverName, String databaseName);

/**
* Lists auditing settings of a database.
*
* @param 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 serverName The name of the server.
* @param databaseName The name of the database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DatabaseBlobAuditingPolicy> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.microsoft.azure.management.sql.v2015_05_01_preview.DatabaseBlobAuditingPolicies;
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.Page;
import com.microsoft.azure.management.sql.v2015_05_01_preview.DatabaseBlobAuditingPolicy;

class DatabaseBlobAuditingPoliciesImpl extends WrapperImpl<DatabaseBlobAuditingPoliciesInner> implements DatabaseBlobAuditingPolicies {
Expand Down Expand Up @@ -40,6 +41,24 @@ private DatabaseBlobAuditingPolicyImpl wrapModel(String name) {
return new DatabaseBlobAuditingPolicyImpl(name, this.manager());
}

@Override
public Observable<DatabaseBlobAuditingPolicy> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName) {
DatabaseBlobAuditingPoliciesInner client = this.inner();
return client.listByDatabaseAsync(resourceGroupName, serverName, databaseName)
.flatMapIterable(new Func1<Page<DatabaseBlobAuditingPolicyInner>, Iterable<DatabaseBlobAuditingPolicyInner>>() {
@Override
public Iterable<DatabaseBlobAuditingPolicyInner> call(Page<DatabaseBlobAuditingPolicyInner> page) {
return page.items();
}
})
.map(new Func1<DatabaseBlobAuditingPolicyInner, DatabaseBlobAuditingPolicy>() {
@Override
public DatabaseBlobAuditingPolicy call(DatabaseBlobAuditingPolicyInner inner) {
return wrapModel(inner);
}
});
}

@Override
public Observable<DatabaseBlobAuditingPolicy> getAsync(String resourceGroupName, String serverName, String databaseName) {
DatabaseBlobAuditingPoliciesInner client = this.inner();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ public interface DatabaseBlobAuditingPolicies extends SupportsCreating<DatabaseB
*/
Observable<DatabaseBlobAuditingPolicy> getAsync(String resourceGroupName, String serverName, String databaseName);

/**
* Lists auditing settings of a database.
*
* @param 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 serverName The name of the server.
* @param databaseName The name of the database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DatabaseBlobAuditingPolicy> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,14 @@ public interface ServerBlobAuditingPolicies extends SupportsCreating<ServerBlobA
*/
Observable<ServerBlobAuditingPolicy> getAsync(String resourceGroupName, String serverName);

/**
* Lists auditing settings of a server.
*
* @param 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 serverName The name of the server.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ServerBlobAuditingPolicy> listByServerAsync(final String resourceGroupName, final String serverName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.microsoft.azure.management.sql.v2017_03_01_preview.DatabaseBlobAuditingPolicies;
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.Page;
import com.microsoft.azure.management.sql.v2017_03_01_preview.DatabaseBlobAuditingPolicy;

class DatabaseBlobAuditingPoliciesImpl extends WrapperImpl<DatabaseBlobAuditingPoliciesInner> implements DatabaseBlobAuditingPolicies {
Expand Down Expand Up @@ -40,6 +41,24 @@ private DatabaseBlobAuditingPolicyImpl wrapModel(String name) {
return new DatabaseBlobAuditingPolicyImpl(name, this.manager());
}

@Override
public Observable<DatabaseBlobAuditingPolicy> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName) {
DatabaseBlobAuditingPoliciesInner client = this.inner();
return client.listByDatabaseAsync(resourceGroupName, serverName, databaseName)
.flatMapIterable(new Func1<Page<DatabaseBlobAuditingPolicyInner>, Iterable<DatabaseBlobAuditingPolicyInner>>() {
@Override
public Iterable<DatabaseBlobAuditingPolicyInner> call(Page<DatabaseBlobAuditingPolicyInner> page) {
return page.items();
}
})
.map(new Func1<DatabaseBlobAuditingPolicyInner, DatabaseBlobAuditingPolicy>() {
@Override
public DatabaseBlobAuditingPolicy call(DatabaseBlobAuditingPolicyInner inner) {
return wrapModel(inner);
}
});
}

@Override
public Observable<DatabaseBlobAuditingPolicy> getAsync(String resourceGroupName, String serverName, String databaseName) {
DatabaseBlobAuditingPoliciesInner client = this.inner();
Expand Down
Loading