From 404544ec44132bd100fc3dc0d3b2396e3b9821bf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 31 Aug 2018 05:33:07 +0000 Subject: [PATCH 1/2] Generated from 2b946c42fe05c892efee90f150c5b2b7897d9e8d Change some string modelled enums back into enums --- .../v2018_07_01_preview/AgreementType.java | 4 +- .../logic/v2018_07_01_preview/DayOfWeek.java | 66 +++++++++++-------- .../logic/v2018_07_01_preview/DaysOfWeek.java | 66 +++++++++++-------- .../EdifactDecimalIndicator.java | 50 ++++++++------ .../logic/v2018_07_01_preview/EventLevel.java | 62 ++++++++++------- .../IntegrationAccountAgreementFilter.java | 6 +- .../SegmentTerminatorSuffix.java | 58 +++++++++------- .../IntegrationAccountAgreementInner.java | 6 +- .../IntegrationAccountSessionsInner.java | 9 +-- 9 files changed, 194 insertions(+), 133 deletions(-) diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java index d94f5c5d64b49..0f0f142205658 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java @@ -25,8 +25,8 @@ public final class AgreementType extends ExpandableStringEnum { /** Static value X12 for AgreementType. */ public static final AgreementType X12 = fromString("X12"); - /** Static value Edifact for AgreementType. */ - public static final AgreementType EDIFACT = fromString("Edifact"); + /** Static value EDIFACT for AgreementType. */ + public static final AgreementType EDIFACT = fromString("EDIFACT"); /** * Creates or finds a AgreementType from its string representation. diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DayOfWeek.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DayOfWeek.java index 168ac497ecfa7..f1ec1904e3825 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DayOfWeek.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DayOfWeek.java @@ -8,49 +8,61 @@ package com.microsoft.azure.management.logic.v2018_07_01_preview; -import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.microsoft.rest.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for DayOfWeek. */ -public final class DayOfWeek extends ExpandableStringEnum { - /** Static value Sunday for DayOfWeek. */ - public static final DayOfWeek SUNDAY = fromString("Sunday"); +public enum DayOfWeek { + /** Enum value Sunday. */ + SUNDAY("Sunday"), - /** Static value Monday for DayOfWeek. */ - public static final DayOfWeek MONDAY = fromString("Monday"); + /** Enum value Monday. */ + MONDAY("Monday"), - /** Static value Tuesday for DayOfWeek. */ - public static final DayOfWeek TUESDAY = fromString("Tuesday"); + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), - /** Static value Wednesday for DayOfWeek. */ - public static final DayOfWeek WEDNESDAY = fromString("Wednesday"); + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), - /** Static value Thursday for DayOfWeek. */ - public static final DayOfWeek THURSDAY = fromString("Thursday"); + /** Enum value Thursday. */ + THURSDAY("Thursday"), - /** Static value Friday for DayOfWeek. */ - public static final DayOfWeek FRIDAY = fromString("Friday"); + /** Enum value Friday. */ + FRIDAY("Friday"), - /** Static value Saturday for DayOfWeek. */ - public static final DayOfWeek SATURDAY = fromString("Saturday"); + /** Enum value Saturday. */ + SATURDAY("Saturday"); + + /** The actual serialized value for a DayOfWeek instance. */ + private String value; + + DayOfWeek(String value) { + this.value = value; + } /** - * Creates or finds a DayOfWeek from its string representation. - * @param name a name to look for - * @return the corresponding DayOfWeek + * Parses a serialized value to a DayOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DayOfWeek object, or null if unable to parse. */ @JsonCreator - public static DayOfWeek fromString(String name) { - return fromString(name, DayOfWeek.class); + public static DayOfWeek fromString(String value) { + DayOfWeek[] items = DayOfWeek.values(); + for (DayOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** - * @return known DayOfWeek values - */ - public static Collection values() { - return values(DayOfWeek.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DaysOfWeek.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DaysOfWeek.java index 9ac2adb6aaebe..66518deab765d 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DaysOfWeek.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/DaysOfWeek.java @@ -8,49 +8,61 @@ package com.microsoft.azure.management.logic.v2018_07_01_preview; -import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.microsoft.rest.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for DaysOfWeek. */ -public final class DaysOfWeek extends ExpandableStringEnum { - /** Static value Sunday for DaysOfWeek. */ - public static final DaysOfWeek SUNDAY = fromString("Sunday"); +public enum DaysOfWeek { + /** Enum value Sunday. */ + SUNDAY("Sunday"), - /** Static value Monday for DaysOfWeek. */ - public static final DaysOfWeek MONDAY = fromString("Monday"); + /** Enum value Monday. */ + MONDAY("Monday"), - /** Static value Tuesday for DaysOfWeek. */ - public static final DaysOfWeek TUESDAY = fromString("Tuesday"); + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), - /** Static value Wednesday for DaysOfWeek. */ - public static final DaysOfWeek WEDNESDAY = fromString("Wednesday"); + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), - /** Static value Thursday for DaysOfWeek. */ - public static final DaysOfWeek THURSDAY = fromString("Thursday"); + /** Enum value Thursday. */ + THURSDAY("Thursday"), - /** Static value Friday for DaysOfWeek. */ - public static final DaysOfWeek FRIDAY = fromString("Friday"); + /** Enum value Friday. */ + FRIDAY("Friday"), - /** Static value Saturday for DaysOfWeek. */ - public static final DaysOfWeek SATURDAY = fromString("Saturday"); + /** Enum value Saturday. */ + SATURDAY("Saturday"); + + /** The actual serialized value for a DaysOfWeek instance. */ + private String value; + + DaysOfWeek(String value) { + this.value = value; + } /** - * Creates or finds a DaysOfWeek from its string representation. - * @param name a name to look for - * @return the corresponding DaysOfWeek + * Parses a serialized value to a DaysOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DaysOfWeek object, or null if unable to parse. */ @JsonCreator - public static DaysOfWeek fromString(String name) { - return fromString(name, DaysOfWeek.class); + public static DaysOfWeek fromString(String value) { + DaysOfWeek[] items = DaysOfWeek.values(); + for (DaysOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** - * @return known DaysOfWeek values - */ - public static Collection values() { - return values(DaysOfWeek.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EdifactDecimalIndicator.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EdifactDecimalIndicator.java index efa2aaa4f8e9a..54e466f94d86f 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EdifactDecimalIndicator.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EdifactDecimalIndicator.java @@ -8,37 +8,49 @@ package com.microsoft.azure.management.logic.v2018_07_01_preview; -import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.microsoft.rest.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for EdifactDecimalIndicator. */ -public final class EdifactDecimalIndicator extends ExpandableStringEnum { - /** Static value NotSpecified for EdifactDecimalIndicator. */ - public static final EdifactDecimalIndicator NOT_SPECIFIED = fromString("NotSpecified"); +public enum EdifactDecimalIndicator { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), - /** Static value Comma for EdifactDecimalIndicator. */ - public static final EdifactDecimalIndicator COMMA = fromString("Comma"); + /** Enum value Comma. */ + COMMA("Comma"), - /** Static value Decimal for EdifactDecimalIndicator. */ - public static final EdifactDecimalIndicator DECIMAL = fromString("Decimal"); + /** Enum value Decimal. */ + DECIMAL("Decimal"); + + /** The actual serialized value for a EdifactDecimalIndicator instance. */ + private String value; + + EdifactDecimalIndicator(String value) { + this.value = value; + } /** - * Creates or finds a EdifactDecimalIndicator from its string representation. - * @param name a name to look for - * @return the corresponding EdifactDecimalIndicator + * Parses a serialized value to a EdifactDecimalIndicator instance. + * + * @param value the serialized value to parse. + * @return the parsed EdifactDecimalIndicator object, or null if unable to parse. */ @JsonCreator - public static EdifactDecimalIndicator fromString(String name) { - return fromString(name, EdifactDecimalIndicator.class); + public static EdifactDecimalIndicator fromString(String value) { + EdifactDecimalIndicator[] items = EdifactDecimalIndicator.values(); + for (EdifactDecimalIndicator item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** - * @return known EdifactDecimalIndicator values - */ - public static Collection values() { - return values(EdifactDecimalIndicator.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EventLevel.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EventLevel.java index 05c3d19526a4e..788c73ab3a090 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EventLevel.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/EventLevel.java @@ -8,46 +8,58 @@ package com.microsoft.azure.management.logic.v2018_07_01_preview; -import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.microsoft.rest.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for EventLevel. */ -public final class EventLevel extends ExpandableStringEnum { - /** Static value LogAlways for EventLevel. */ - public static final EventLevel LOG_ALWAYS = fromString("LogAlways"); +public enum EventLevel { + /** Enum value LogAlways. */ + LOG_ALWAYS("LogAlways"), - /** Static value Critical for EventLevel. */ - public static final EventLevel CRITICAL = fromString("Critical"); + /** Enum value Critical. */ + CRITICAL("Critical"), - /** Static value Error for EventLevel. */ - public static final EventLevel ERROR = fromString("Error"); + /** Enum value Error. */ + ERROR("Error"), - /** Static value Warning for EventLevel. */ - public static final EventLevel WARNING = fromString("Warning"); + /** Enum value Warning. */ + WARNING("Warning"), - /** Static value Informational for EventLevel. */ - public static final EventLevel INFORMATIONAL = fromString("Informational"); + /** Enum value Informational. */ + INFORMATIONAL("Informational"), - /** Static value Verbose for EventLevel. */ - public static final EventLevel VERBOSE = fromString("Verbose"); + /** Enum value Verbose. */ + VERBOSE("Verbose"); + + /** The actual serialized value for a EventLevel instance. */ + private String value; + + EventLevel(String value) { + this.value = value; + } /** - * Creates or finds a EventLevel from its string representation. - * @param name a name to look for - * @return the corresponding EventLevel + * Parses a serialized value to a EventLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed EventLevel object, or null if unable to parse. */ @JsonCreator - public static EventLevel fromString(String name) { - return fromString(name, EventLevel.class); + public static EventLevel fromString(String value) { + EventLevel[] items = EventLevel.values(); + for (EventLevel item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** - * @return known EventLevel values - */ - public static Collection values() { - return values(EventLevel.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java index 5e5c91d491381..a33da9c6633de 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java @@ -16,13 +16,13 @@ public class IntegrationAccountAgreementFilter { /** * The agreement type of integration account agreement. Possible values - * include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. + * include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. */ @JsonProperty(value = "agreementType", required = true) private AgreementType agreementType; /** - * Get the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. + * Get the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. * * @return the agreementType value */ @@ -31,7 +31,7 @@ public AgreementType agreementType() { } /** - * Set the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. + * Set the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. * * @param agreementType the agreementType value to set * @return the IntegrationAccountAgreementFilter object itself. diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/SegmentTerminatorSuffix.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/SegmentTerminatorSuffix.java index cc4f1983924e7..6222b4802a2bd 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/SegmentTerminatorSuffix.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/SegmentTerminatorSuffix.java @@ -8,43 +8,55 @@ package com.microsoft.azure.management.logic.v2018_07_01_preview; -import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.microsoft.rest.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for SegmentTerminatorSuffix. */ -public final class SegmentTerminatorSuffix extends ExpandableStringEnum { - /** Static value NotSpecified for SegmentTerminatorSuffix. */ - public static final SegmentTerminatorSuffix NOT_SPECIFIED = fromString("NotSpecified"); +public enum SegmentTerminatorSuffix { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), - /** Static value None for SegmentTerminatorSuffix. */ - public static final SegmentTerminatorSuffix NONE = fromString("None"); + /** Enum value None. */ + NONE("None"), - /** Static value CR for SegmentTerminatorSuffix. */ - public static final SegmentTerminatorSuffix CR = fromString("CR"); + /** Enum value CR. */ + CR("CR"), - /** Static value LF for SegmentTerminatorSuffix. */ - public static final SegmentTerminatorSuffix LF = fromString("LF"); + /** Enum value LF. */ + LF("LF"), - /** Static value CRLF for SegmentTerminatorSuffix. */ - public static final SegmentTerminatorSuffix CRLF = fromString("CRLF"); + /** Enum value CRLF. */ + CRLF("CRLF"); + + /** The actual serialized value for a SegmentTerminatorSuffix instance. */ + private String value; + + SegmentTerminatorSuffix(String value) { + this.value = value; + } /** - * Creates or finds a SegmentTerminatorSuffix from its string representation. - * @param name a name to look for - * @return the corresponding SegmentTerminatorSuffix + * Parses a serialized value to a SegmentTerminatorSuffix instance. + * + * @param value the serialized value to parse. + * @return the parsed SegmentTerminatorSuffix object, or null if unable to parse. */ @JsonCreator - public static SegmentTerminatorSuffix fromString(String name) { - return fromString(name, SegmentTerminatorSuffix.class); + public static SegmentTerminatorSuffix fromString(String value) { + SegmentTerminatorSuffix[] items = SegmentTerminatorSuffix.values(); + for (SegmentTerminatorSuffix item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** - * @return known SegmentTerminatorSuffix values - */ - public static Collection values() { - return values(SegmentTerminatorSuffix.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java index ad3007cb716e6..80cb66d600a02 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java @@ -43,7 +43,7 @@ public class IntegrationAccountAgreementInner extends Resource { /** * The agreement type. Possible values include: 'NotSpecified', 'AS2', - * 'X12', 'Edifact'. + * 'X12', 'EDIFACT'. */ @JsonProperty(value = "properties.agreementType", required = true) private AgreementType agreementType; @@ -119,7 +119,7 @@ public IntegrationAccountAgreementInner withMetadata(Object metadata) { } /** - * Get the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. + * Get the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. * * @return the agreementType value */ @@ -128,7 +128,7 @@ public AgreementType agreementType() { } /** - * Set the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. + * Set the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. * * @param agreementType the agreementType value to set * @return the IntegrationAccountAgreementInner object itself. diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountSessionsInner.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountSessionsInner.java index c124c2fe26a5c..c547656e62775 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountSessionsInner.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountSessionsInner.java @@ -11,6 +11,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.logic.v2018_07_01_preview.ErrorResponseException; import com.microsoft.azure.Page; @@ -536,7 +537,7 @@ private ServiceResponse createOrUpdateDelegate(R * @param integrationAccountName The integration account name. * @param sessionName The integration account session name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server + * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void delete(String resourceGroupName, String integrationAccountName, String sessionName) { @@ -614,11 +615,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorResponseException.class) + .registerError(CloudException.class) .build(response); } From a4daa48c79217fb540654b2c8a4d12af85e01dae Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 7 Sep 2018 18:20:18 +0000 Subject: [PATCH 2/2] Generated from c016726b2b4438bf45bdbebe25f68a67330478b0 Change EDIFACT back to be an enum, not a string --- .../v2018_07_01_preview/AgreementType.java | 54 +++++++++++-------- .../IntegrationAccountAgreementFilter.java | 6 +-- .../IntegrationAccountAgreementInner.java | 6 +-- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java index 0f0f142205658..1ed3401388b39 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/AgreementType.java @@ -8,40 +8,52 @@ package com.microsoft.azure.management.logic.v2018_07_01_preview; -import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.microsoft.rest.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for AgreementType. */ -public final class AgreementType extends ExpandableStringEnum { - /** Static value NotSpecified for AgreementType. */ - public static final AgreementType NOT_SPECIFIED = fromString("NotSpecified"); +public enum AgreementType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), - /** Static value AS2 for AgreementType. */ - public static final AgreementType AS2 = fromString("AS2"); + /** Enum value AS2. */ + AS2("AS2"), - /** Static value X12 for AgreementType. */ - public static final AgreementType X12 = fromString("X12"); + /** Enum value X12. */ + X12("X12"), - /** Static value EDIFACT for AgreementType. */ - public static final AgreementType EDIFACT = fromString("EDIFACT"); + /** Enum value Edifact. */ + EDIFACT("Edifact"); + + /** The actual serialized value for a AgreementType instance. */ + private String value; + + AgreementType(String value) { + this.value = value; + } /** - * Creates or finds a AgreementType from its string representation. - * @param name a name to look for - * @return the corresponding AgreementType + * Parses a serialized value to a AgreementType instance. + * + * @param value the serialized value to parse. + * @return the parsed AgreementType object, or null if unable to parse. */ @JsonCreator - public static AgreementType fromString(String name) { - return fromString(name, AgreementType.class); + public static AgreementType fromString(String value) { + AgreementType[] items = AgreementType.values(); + for (AgreementType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** - * @return known AgreementType values - */ - public static Collection values() { - return values(AgreementType.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java index a33da9c6633de..5e5c91d491381 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/IntegrationAccountAgreementFilter.java @@ -16,13 +16,13 @@ public class IntegrationAccountAgreementFilter { /** * The agreement type of integration account agreement. Possible values - * include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. + * include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. */ @JsonProperty(value = "agreementType", required = true) private AgreementType agreementType; /** - * Get the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. + * Get the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. * * @return the agreementType value */ @@ -31,7 +31,7 @@ public AgreementType agreementType() { } /** - * Set the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. + * Set the agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. * * @param agreementType the agreementType value to set * @return the IntegrationAccountAgreementFilter object itself. diff --git a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java index 80cb66d600a02..ad3007cb716e6 100644 --- a/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java +++ b/logic/resource-manager/v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/implementation/IntegrationAccountAgreementInner.java @@ -43,7 +43,7 @@ public class IntegrationAccountAgreementInner extends Resource { /** * The agreement type. Possible values include: 'NotSpecified', 'AS2', - * 'X12', 'EDIFACT'. + * 'X12', 'Edifact'. */ @JsonProperty(value = "properties.agreementType", required = true) private AgreementType agreementType; @@ -119,7 +119,7 @@ public IntegrationAccountAgreementInner withMetadata(Object metadata) { } /** - * Get the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. + * Get the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. * * @return the agreementType value */ @@ -128,7 +128,7 @@ public AgreementType agreementType() { } /** - * Set the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'EDIFACT'. + * Set the agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact'. * * @param agreementType the agreementType value to set * @return the IntegrationAccountAgreementInner object itself.