Skip to content

Commit

Permalink
Generated from b77f5d1a2652b84a016c368bff34ec26940facac (#2552)
Browse files Browse the repository at this point in the history
Update DatabaseVulnerabilityAssessmentListByDatabase.json
  • Loading branch information
AutorestCI authored Oct 31, 2018
1 parent a03d011 commit e472346
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public interface DatabaseVulnerabilityAssessment extends HasInner<DatabaseVulner
/**
* The entirety of the DatabaseVulnerabilityAssessment definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithStorageContainerPath, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithCreate {
}

/**
Expand All @@ -80,17 +80,7 @@ interface WithDatabasis {
/**
* Specifies resourceGroupName, managedInstanceName, databaseName.
*/
WithStorageContainerPath withExistingDatabasis(String resourceGroupName, String managedInstanceName, String databaseName);
}

/**
* The stage of the databasevulnerabilityassessment definition allowing to specify StorageContainerPath.
*/
interface WithStorageContainerPath {
/**
* Specifies storageContainerPath.
*/
WithCreate withStorageContainerPath(String storageContainerPath);
WithCreate withExistingDatabasis(String resourceGroupName, String managedInstanceName, String databaseName);
}

/**
Expand All @@ -113,6 +103,16 @@ interface WithStorageAccountAccessKey {
WithCreate withStorageAccountAccessKey(String storageAccountAccessKey);
}

/**
* The stage of the databasevulnerabilityassessment definition allowing to specify StorageContainerPath.
*/
interface WithStorageContainerPath {
/**
* Specifies storageContainerPath.
*/
WithCreate withStorageContainerPath(String storageContainerPath);
}

/**
* The stage of the databasevulnerabilityassessment definition allowing to specify StorageContainerSasKey.
*/
Expand All @@ -128,13 +128,13 @@ interface WithStorageContainerSasKey {
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends Creatable<DatabaseVulnerabilityAssessment>, DefinitionStages.WithRecurringScans, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageContainerSasKey {
interface WithCreate extends Creatable<DatabaseVulnerabilityAssessment>, DefinitionStages.WithRecurringScans, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageContainerPath, DefinitionStages.WithStorageContainerSasKey {
}
}
/**
* The template for a DatabaseVulnerabilityAssessment update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<DatabaseVulnerabilityAssessment>, UpdateStages.WithRecurringScans, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageContainerSasKey {
interface Update extends Appliable<DatabaseVulnerabilityAssessment>, UpdateStages.WithRecurringScans, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageContainerPath, UpdateStages.WithStorageContainerSasKey {
}

/**
Expand All @@ -161,6 +161,16 @@ interface WithStorageAccountAccessKey {
Update withStorageAccountAccessKey(String storageAccountAccessKey);
}

/**
* The stage of the databasevulnerabilityassessment update allowing to specify StorageContainerPath.
*/
interface WithStorageContainerPath {
/**
* Specifies storageContainerPath.
*/
Update withStorageContainerPath(String storageContainerPath);
}

/**
* The stage of the databasevulnerabilityassessment update allowing to specify StorageContainerSasKey.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package com.microsoft.azure.management.sql.v2017_10_01_preview;

import rx.Observable;
import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessment;
import rx.Completable;

/**
Expand All @@ -33,6 +34,17 @@ public interface ManagedDatabaseVulnerabilityAssessments {
*/
Observable<DatabaseVulnerabilityAssessment> getAsync(String resourceGroupName, String managedInstanceName, String databaseName);

/**
* Lists the vulnerability assessments of a managed 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 managedInstanceName The name of the managed instance.
* @param databaseName The name of the database for which the vulnerability assessment is defined.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DatabaseVulnerabilityAssessment> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName);

/**
* Removes the database's vulnerability assessment.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ public DatabaseVulnerabilityAssessmentImpl withExistingDatabasis(String resource
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) {
this.inner().withStorageContainerPath(storageContainerPath);
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans) {
this.inner().withRecurringScans(recurringScans);
Expand All @@ -131,6 +125,12 @@ public DatabaseVulnerabilityAssessmentImpl withStorageAccountAccessKey(String st
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) {
this.inner().withStorageContainerPath(storageContainerPath);
return this;
}

@Override
public DatabaseVulnerabilityAssessmentImpl withStorageContainerSasKey(String storageContainerSasKey) {
this.inner().withStorageContainerSasKey(storageContainerSasKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
public class DatabaseVulnerabilityAssessmentInner extends ProxyResource {
/**
* A blob storage container path to hold the scan results (e.g.
* https://myStorage.blob.core.windows.net/VaScans/).
* https://myStorage.blob.core.windows.net/VaScans/). It is required if
* server level vulnerability assessment policy doesn't set.
*/
@JsonProperty(value = "properties.storageContainerPath", required = true)
@JsonProperty(value = "properties.storageContainerPath")
private String storageContainerPath;

/**
Expand All @@ -35,8 +36,8 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource {
private String storageContainerSasKey;

/**
* Specifies the identifier key of the vulnerability assessment storage
* account. If 'StorageContainerSasKey' isn't specified,
* Specifies the identifier key of the storage account for vulnerability
* assessment scan results. If 'StorageContainerSasKey' isn't specified,
* storageAccountAccessKey is required.
*/
@JsonProperty(value = "properties.storageAccountAccessKey")
Expand All @@ -49,7 +50,7 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource {
private VulnerabilityAssessmentRecurringScansProperties recurringScans;

/**
* Get a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
* Get a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set.
*
* @return the storageContainerPath value
*/
Expand All @@ -58,7 +59,7 @@ public String storageContainerPath() {
}

/**
* Set a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
* Set a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set.
*
* @param storageContainerPath the storageContainerPath value to set
* @return the DatabaseVulnerabilityAssessmentInner object itself.
Expand Down Expand Up @@ -89,7 +90,7 @@ public DatabaseVulnerabilityAssessmentInner withStorageContainerSasKey(String st
}

/**
* Get specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
* Get specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
*
* @return the storageAccountAccessKey value
*/
Expand All @@ -98,7 +99,7 @@ public String storageAccountAccessKey() {
}

/**
* Set specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
* Set specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
*
* @param storageAccountAccessKey the storageAccountAccessKey value to set
* @return the DatabaseVulnerabilityAssessmentInner object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessment;
import com.microsoft.azure.Page;
import rx.Completable;

class ManagedDatabaseVulnerabilityAssessmentsImpl extends WrapperImpl<ManagedDatabaseVulnerabilityAssessmentsInner> implements ManagedDatabaseVulnerabilityAssessments {
Expand Down Expand Up @@ -61,6 +62,24 @@ public DatabaseVulnerabilityAssessment call(DatabaseVulnerabilityAssessmentInner
});
}

@Override
public Observable<DatabaseVulnerabilityAssessment> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) {
ManagedDatabaseVulnerabilityAssessmentsInner client = this.inner();
return client.listByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName)
.flatMapIterable(new Func1<Page<DatabaseVulnerabilityAssessmentInner>, Iterable<DatabaseVulnerabilityAssessmentInner>>() {
@Override
public Iterable<DatabaseVulnerabilityAssessmentInner> call(Page<DatabaseVulnerabilityAssessmentInner> page) {
return page.items();
}
})
.map(new Func1<DatabaseVulnerabilityAssessmentInner, DatabaseVulnerabilityAssessment>() {
@Override
public DatabaseVulnerabilityAssessment call(DatabaseVulnerabilityAssessmentInner inner) {
return wrapDatabaseVulnerabilityAssessmentModel(inner);
}
});
}

@Override
public Completable deleteAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
ManagedDatabaseVulnerabilityAssessmentsInner client = this.inner();
Expand Down
Loading

0 comments on commit e472346

Please sign in to comment.