Skip to content
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 @@ -249,7 +249,7 @@ interface WithCreate extends Creatable<DatabaseAccountGetResults>, Resource.Defi
/**
* The template for a DatabaseAccountGetResults update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<DatabaseAccountGetResults>, Resource.UpdateWithTags<Update>, UpdateStages.WithApiProperties, UpdateStages.WithBackupPolicy, UpdateStages.WithCapabilities, UpdateStages.WithConnectorOffer, UpdateStages.WithConsistencyPolicy, UpdateStages.WithCors, UpdateStages.WithDisableKeyBasedMetadataWriteAccess, UpdateStages.WithEnableAnalyticalStorage, UpdateStages.WithEnableAutomaticFailover, UpdateStages.WithEnableCassandraConnector, UpdateStages.WithEnableFreeTier, UpdateStages.WithEnableMultipleWriteLocations, UpdateStages.WithIpRules, UpdateStages.WithIsVirtualNetworkFilterEnabled, UpdateStages.WithKeyVaultKeyUri, UpdateStages.WithLocations, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithVirtualNetworkRules {
interface Update extends Appliable<DatabaseAccountGetResults>, Resource.UpdateWithTags<Update>, UpdateStages.WithApiProperties, UpdateStages.WithBackupPolicy, UpdateStages.WithCapabilities, UpdateStages.WithConnectorOffer, UpdateStages.WithConsistencyPolicy, UpdateStages.WithCors, UpdateStages.WithDisableKeyBasedMetadataWriteAccess, UpdateStages.WithEnableAnalyticalStorage, UpdateStages.WithEnableAutomaticFailover, UpdateStages.WithEnableCassandraConnector, UpdateStages.WithEnableFreeTier, UpdateStages.WithEnableMultipleWriteLocations, UpdateStages.WithIdentity, UpdateStages.WithIpRules, UpdateStages.WithIsVirtualNetworkFilterEnabled, UpdateStages.WithKeyVaultKeyUri, UpdateStages.WithLocations, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithVirtualNetworkRules {
}

/**
Expand Down Expand Up @@ -400,6 +400,18 @@ interface WithEnableMultipleWriteLocations {
Update withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations);
}

/**
* The stage of the databaseaccountgetresults update allowing to specify Identity.
*/
interface WithIdentity {
/**
* Specifies identity.
* @param identity the identity parameter value
* @return the next update stage
*/
Update withIdentity(ManagedServiceIdentity identity);
}

/**
* The stage of the databaseaccountgetresults update allowing to specify IpRules.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ public class DatabaseAccountUpdateParameters {
@JsonProperty(value = "properties.cors")
private List<CorsPolicy> cors;

/**
* The identity property.
*/
@JsonProperty(value = "identity")
private ManagedServiceIdentity identity;

/**
* Get the tags value.
*
Expand Down Expand Up @@ -545,4 +551,24 @@ public DatabaseAccountUpdateParameters withCors(List<CorsPolicy> cors) {
return this;
}

/**
* Get the identity value.
*
* @return the identity value
*/
public ManagedServiceIdentity identity() {
return this.identity;
}

/**
* Set the identity value.
*
* @param identity the identity value to set
* @return the DatabaseAccountUpdateParameters object itself.
*/
public DatabaseAccountUpdateParameters withIdentity(ManagedServiceIdentity identity) {
this.identity = identity;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview;

import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand All @@ -29,15 +30,23 @@ public class ManagedServiceIdentity {
private String tenantId;

/**
* The type of identity used for the resource. The type 'SystemAssigned,
* UserAssigned' includes both an implicitly created identity and a set of
* user assigned identities. The type 'None' will remove any identities
* from the service. Possible values include: 'SystemAssigned',
* 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'.
* The type of identity used for the resource. The type
* 'SystemAssigned,UserAssigned' includes both an implicitly created
* identity and a set of user assigned identities. The type 'None' will
* remove any identities from the service. Possible values include:
* 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', 'None'.
*/
@JsonProperty(value = "type")
private ResourceIdentityType type;

/**
* The list of user identities associated with resource. The user identity
* dictionary key references will be ARM resource ids in the form:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
@JsonProperty(value = "userAssignedIdentities")
private Map<String, ManagedServiceIdentityUserAssignedIdentitiesValue> userAssignedIdentities;

/**
* Get the principal id of the system assigned identity. This property will only be provided for a system assigned identity.
*
Expand All @@ -57,7 +66,7 @@ public String tenantId() {
}

/**
* Get the type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'.
* Get the type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', 'None'.
*
* @return the type value
*/
Expand All @@ -66,7 +75,7 @@ public ResourceIdentityType type() {
}

/**
* Set the type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'.
* Set the type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', 'None'.
*
* @param type the type value to set
* @return the ManagedServiceIdentity object itself.
Expand All @@ -76,4 +85,24 @@ public ManagedServiceIdentity withType(ResourceIdentityType type) {
return this;
}

/**
* Get the list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*
* @return the userAssignedIdentities value
*/
public Map<String, ManagedServiceIdentityUserAssignedIdentitiesValue> userAssignedIdentities() {
return this.userAssignedIdentities;
}

/**
* Set the list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*
* @param userAssignedIdentities the userAssignedIdentities value to set
* @return the ManagedServiceIdentity object itself.
*/
public ManagedServiceIdentity withUserAssignedIdentities(Map<String, ManagedServiceIdentityUserAssignedIdentitiesValue> userAssignedIdentities) {
this.userAssignedIdentities = userAssignedIdentities;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The ManagedServiceIdentityUserAssignedIdentitiesValue model.
*/
public class ManagedServiceIdentityUserAssignedIdentitiesValue {
/**
* The principal id of user assigned identity.
*/
@JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY)
private String principalId;

/**
* The client id of user assigned identity.
*/
@JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY)
private String clientId;

/**
* Get the principal id of user assigned identity.
*
* @return the principalId value
*/
public String principalId() {
return this.principalId;
}

/**
* Get the client id of user assigned identity.
*
* @return the clientId value
*/
public String clientId() {
return this.clientId;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public enum ResourceIdentityType {
/** Enum value UserAssigned. */
USER_ASSIGNED("UserAssigned"),

/** Enum value SystemAssigned, UserAssigned. */
SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"),
/** Enum value SystemAssigned,UserAssigned. */
SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned,UserAssigned"),

/** Enum value None. */
NONE("None");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.RestoreParameters;
import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SystemData;
import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.VirtualNetworkRule;
import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.DatabaseAccountCreateUpdateProperties;
import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ManagedServiceIdentity;
import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.DatabaseAccountCreateUpdateProperties;
import rx.functions.Func1;

class DatabaseAccountGetResultsImpl extends GroupableResourceCoreImpl<DatabaseAccountGetResults, DatabaseAccountGetResultsInner, DatabaseAccountGetResultsImpl, CosmosDBManager> implements DatabaseAccountGetResults, DatabaseAccountGetResults.Definition, DatabaseAccountGetResults.Update {
Expand Down Expand Up @@ -258,12 +258,6 @@ public DatabaseAccountGetResultsImpl withProperties(DatabaseAccountCreateUpdateP
return this;
}

@Override
public DatabaseAccountGetResultsImpl withIdentity(ManagedServiceIdentity identity) {
this.createParameter.withIdentity(identity);
return this;
}

@Override
public DatabaseAccountGetResultsImpl withKind(DatabaseAccountKind kind) {
this.createParameter.withKind(kind);
Expand Down Expand Up @@ -378,4 +372,14 @@ public DatabaseAccountGetResultsImpl withVirtualNetworkRules(List<VirtualNetwork
return this;
}

@Override
public DatabaseAccountGetResultsImpl withIdentity(ManagedServiceIdentity identity) {
if (isInCreateMode()) {
this.createParameter.withIdentity(identity);
} else {
this.updateParameter.withIdentity(identity);
}
return this;
}

}