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

mgmt regen resources #12794

Merged
Merged
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 @@ -20,6 +20,7 @@
import com.azure.resourcemanager.keyvault.models.NetworkRuleSet;
import com.azure.resourcemanager.keyvault.models.Secrets;
import com.azure.resourcemanager.keyvault.models.Sku;
import com.azure.resourcemanager.keyvault.models.SkuFamily;
import com.azure.resourcemanager.keyvault.models.SkuName;
import com.azure.resourcemanager.keyvault.models.Vault;
import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters;
Expand Down Expand Up @@ -283,7 +284,7 @@ public VaultImpl withSku(SkuName skuName) {
if (inner().properties() == null) {
inner().withProperties(new VaultProperties());
}
inner().properties().withSku(new Sku().withName(skuName));
inner().properties().withSku(new Sku().withName(skuName).withFamily(SkuFamily.A));
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.azure.resourcemanager.keyvault.models.CreateMode;
import com.azure.resourcemanager.keyvault.models.DeletedVault;
import com.azure.resourcemanager.keyvault.models.Sku;
import com.azure.resourcemanager.keyvault.models.SkuFamily;
import com.azure.resourcemanager.keyvault.models.SkuName;
import com.azure.resourcemanager.keyvault.models.Vault;
import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters;
Expand Down Expand Up @@ -145,7 +146,7 @@ public Mono<Vault> recoverSoftDeletedVaultAsync(
.withProperties(
new VaultProperties()
.withCreateMode(CreateMode.RECOVER)
.withSku(new Sku().withName(SkuName.STANDARD))
.withSku(new Sku().withName(SkuName.STANDARD).withFamily(SkuFamily.A))
.withTenantId(UUID.fromString(tenantId)));
return inner()
.createOrUpdateAsync(resourceGroupName, vaultName, parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class Sku {
* SKU family name
*/
@JsonProperty(value = "family", required = true)
private String family;
private SkuFamily family;

/*
* SKU name to specify whether the key vault is a standard vault or a
Expand All @@ -27,17 +27,12 @@ public final class Sku {
@JsonProperty(value = "name", required = true)
private SkuName name;

/** Creates an instance of Sku class. */
public Sku() {
family = "A";
}
Comment on lines -31 to -33
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/**
* Get the family property: SKU family name.
*
* @return the family value.
*/
public String family() {
public SkuFamily family() {
return this.family;
}

Expand All @@ -47,7 +42,7 @@ public String family() {
* @param family the family value to set.
* @return the Sku object itself.
*/
public Sku withFamily(String family) {
public Sku withFamily(SkuFamily family) {
this.family = family;
return this;
}
Expand Down Expand Up @@ -78,6 +73,10 @@ public Sku withName(SkuName name) {
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (family() == null) {
throw logger
.logExceptionAsError(new IllegalArgumentException("Missing required property family in model Sku"));
}
if (name() == null) {
throw logger
.logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.keyvault.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for SkuFamily. */
public final class SkuFamily extends ExpandableStringEnum<SkuFamily> {
/** Static value A for SkuFamily. */
public static final SkuFamily A = fromString("A");

/**
* Creates or finds a SkuFamily from its string representation.
*
* @param name a name to look for.
* @return the corresponding SkuFamily.
*/
@JsonCreator
public static SkuFamily fromString(String name) {
return fromString(name, SkuFamily.class);
}

/** @return known SkuFamily values. */
public static Collection<SkuFamily> values() {
return values(SkuFamily.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.network.models.UsageName;
import com.azure.resourcemanager.network.models.UsageUnit;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -25,7 +26,7 @@ public final class UsageInner {
* An enum describing the unit of measurement.
*/
@JsonProperty(value = "unit", required = true)
private String unit;
private UsageUnit unit;

/*
* The current value of the usage.
Expand All @@ -45,11 +46,6 @@ public final class UsageInner {
@JsonProperty(value = "name", required = true)
private UsageName name;

/** Creates an instance of UsageInner class. */
public UsageInner() {
unit = "Count";
}

/**
* Get the id property: Resource identifier.
*
Expand All @@ -64,7 +60,7 @@ public String id() {
*
* @return the unit value.
*/
public String unit() {
public UsageUnit unit() {
return this.unit;
}

Expand All @@ -74,7 +70,7 @@ public String unit() {
* @param unit the unit value to set.
* @return the UsageInner object itself.
*/
public UsageInner withUnit(String unit) {
public UsageInner withUnit(UsageUnit unit) {
this.unit = unit;
return this;
}
Expand Down Expand Up @@ -145,6 +141,11 @@ public UsageInner withName(UsageName name) {
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (unit() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property unit in model UsageInner"));
}
if (name() == null) {
throw logger
.logExceptionAsError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
package com.azure.resourcemanager.network.implementation;

import com.azure.resourcemanager.network.models.NetworkUsage;
import com.azure.resourcemanager.network.models.NetworkUsageUnit;
import com.azure.resourcemanager.network.models.UsageName;
import com.azure.resourcemanager.network.fluent.inner.UsageInner;
import com.azure.resourcemanager.network.models.UsageUnit;
import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl;
import com.azure.resourcemanager.resources.fluentcore.utils.Utils;

Expand All @@ -16,8 +16,8 @@ class NetworkUsageImpl extends WrapperImpl<UsageInner> implements NetworkUsage {
}

@Override
public NetworkUsageUnit unit() {
return NetworkUsageUnit.fromString(inner().unit());
public UsageUnit unit() {
return inner().unit();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,28 @@

package com.azure.resourcemanager.network.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collection;

/** Defines values for AzureFirewallSkuTier. */
public enum AzureFirewallSkuTier {
/** Enum value Standard. */
STANDARD("Standard");

/** The actual serialized value for a AzureFirewallSkuTier instance. */
private final String value;

AzureFirewallSkuTier(String value) {
this.value = value;
}
public final class AzureFirewallSkuTier extends ExpandableStringEnum<AzureFirewallSkuTier> {
/** Static value Standard for AzureFirewallSkuTier. */
public static final AzureFirewallSkuTier STANDARD = fromString("Standard");

/**
* Parses a serialized value to a AzureFirewallSkuTier instance.
* Creates or finds a AzureFirewallSkuTier from its string representation.
*
* @param value the serialized value to parse.
* @return the parsed AzureFirewallSkuTier object, or null if unable to parse.
* @param name a name to look for.
* @return the corresponding AzureFirewallSkuTier.
*/
@JsonCreator
public static AzureFirewallSkuTier fromString(String value) {
AzureFirewallSkuTier[] items = AzureFirewallSkuTier.values();
for (AzureFirewallSkuTier item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
public static AzureFirewallSkuTier fromString(String name) {
return fromString(name, AzureFirewallSkuTier.class);
}

@JsonValue
@Override
public String toString() {
return this.value;
/** @return known AzureFirewallSkuTier values. */
public static Collection<AzureFirewallSkuTier> values() {
return values(AzureFirewallSkuTier.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,29 @@

package com.azure.resourcemanager.network.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collection;

/** Defines values for ConnectionMonitorEndpointFilterItemType. */
public enum ConnectionMonitorEndpointFilterItemType {
/** Enum value AgentAddress. */
AGENT_ADDRESS("AgentAddress");

/** The actual serialized value for a ConnectionMonitorEndpointFilterItemType instance. */
private final String value;

ConnectionMonitorEndpointFilterItemType(String value) {
this.value = value;
}
public final class ConnectionMonitorEndpointFilterItemType
extends ExpandableStringEnum<ConnectionMonitorEndpointFilterItemType> {
/** Static value AgentAddress for ConnectionMonitorEndpointFilterItemType. */
public static final ConnectionMonitorEndpointFilterItemType AGENT_ADDRESS = fromString("AgentAddress");

/**
* Parses a serialized value to a ConnectionMonitorEndpointFilterItemType instance.
* Creates or finds a ConnectionMonitorEndpointFilterItemType from its string representation.
*
* @param value the serialized value to parse.
* @return the parsed ConnectionMonitorEndpointFilterItemType object, or null if unable to parse.
* @param name a name to look for.
* @return the corresponding ConnectionMonitorEndpointFilterItemType.
*/
@JsonCreator
public static ConnectionMonitorEndpointFilterItemType fromString(String value) {
ConnectionMonitorEndpointFilterItemType[] items = ConnectionMonitorEndpointFilterItemType.values();
for (ConnectionMonitorEndpointFilterItemType item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
public static ConnectionMonitorEndpointFilterItemType fromString(String name) {
return fromString(name, ConnectionMonitorEndpointFilterItemType.class);
}

@JsonValue
@Override
public String toString() {
return this.value;
/** @return known ConnectionMonitorEndpointFilterItemType values. */
public static Collection<ConnectionMonitorEndpointFilterItemType> values() {
return values(ConnectionMonitorEndpointFilterItemType.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,29 @@

package com.azure.resourcemanager.network.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collection;

/** Defines values for ConnectionMonitorEndpointFilterType. */
public enum ConnectionMonitorEndpointFilterType {
/** Enum value Include. */
INCLUDE("Include");

/** The actual serialized value for a ConnectionMonitorEndpointFilterType instance. */
private final String value;

ConnectionMonitorEndpointFilterType(String value) {
this.value = value;
}
public final class ConnectionMonitorEndpointFilterType
extends ExpandableStringEnum<ConnectionMonitorEndpointFilterType> {
/** Static value Include for ConnectionMonitorEndpointFilterType. */
public static final ConnectionMonitorEndpointFilterType INCLUDE = fromString("Include");

/**
* Parses a serialized value to a ConnectionMonitorEndpointFilterType instance.
* Creates or finds a ConnectionMonitorEndpointFilterType from its string representation.
*
* @param value the serialized value to parse.
* @return the parsed ConnectionMonitorEndpointFilterType object, or null if unable to parse.
* @param name a name to look for.
* @return the corresponding ConnectionMonitorEndpointFilterType.
*/
@JsonCreator
public static ConnectionMonitorEndpointFilterType fromString(String value) {
ConnectionMonitorEndpointFilterType[] items = ConnectionMonitorEndpointFilterType.values();
for (ConnectionMonitorEndpointFilterType item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
public static ConnectionMonitorEndpointFilterType fromString(String name) {
return fromString(name, ConnectionMonitorEndpointFilterType.class);
}

@JsonValue
@Override
public String toString() {
return this.value;
/** @return known ConnectionMonitorEndpointFilterType values. */
public static Collection<ConnectionMonitorEndpointFilterType> values() {
return values(ConnectionMonitorEndpointFilterType.class);
}
}
Loading