-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
In toJson
, it called non-exist toInt
method on extensible enum whose value is Integer.
#2841
Comments
toJson
, it called non-exist toInt
method on extensible enum whose value is Integer.toJson
, it called non-exist toInt
method on extensible enum whose value is Integer.
Discussed with srikanta, will wait for azure-core support(currently on non-branding). |
TypeSpec
GeneratedCodepublic final class ReleaseDelay implements ExpandableEnum<Integer> {
private static final Map<Integer, ReleaseDelay> VALUES = new ConcurrentHashMap<>();
private final Integer value;
private ReleaseDelay(Integer value) {
this.value= value;
}
@Override
public Integer getValue() {
return value;
}
/**
* Gets all known {@link ReleaseDelay} values.
*
* @return The known {@link ReleaseDelay} values.
*/
public static Collection<ReleaseDelay> values() {
return VALUES.values();
}
/**
* Creates or finds a {@link ReleaseDelay} for the passed {@code value}.
*
* <p>{@code null} will be returned if {@code value} is {@code null}.</p>
*
* @param value A value to look for.
*
* @return The corresponding {@link ReleaseDelay} of the provided value, or {@code null} if {@code value} was
* {@code null}.
*/
public static ReleaseDelay fromInt(Integer value) {
if (value == null) {
return null;
}
ReleaseDelay member = VALUES.get(value);
if (member!= null) {
return member;
}
return VALUES.computeIfAbsent(value, ReleaseDelay::new);
}
@Override
public String toString() {
return Objects.toString(value);
}
@Override
public int hashCode() {
return Objects.hashCode(value);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ReleaseDelay)) {
return false;
}
ReleaseDelay other = (ReleaseDelay) obj;
return Objects.equals(value, other.value);
}
/**
* Release the event after 0 seconds.
*/
public static final ReleaseDelay BY0SECONDS= fromInt(0);
/**
* Release the event after 10 seconds.
*/
public static final ReleaseDelay BY10SECONDS = fromInt(10);
/**
* Release the event after 60 seconds.
*/
public static final ReleaseDelay BY60SECONDS = fromInt(60);
/**
* Release the event after 600 seconds.
*/
public static final ReleaseDelay BY600SECONDS = fromInt(600);
/**
* Release the event after 3600 seconds.
*/
public static final ReleaseDelay BY3600SECONDS = fromInt(3600);
} Discussion
|
9-12 discussion conclusion:
|
We should also deal with unbranded. 9-26 discussion:
|
Swagger:
https://github.com/Azure/azure-rest-api-specs/blob/1cb8cb0a95c20513c5d767614888f415be99245d/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/storagemover.json#L1853-L1856
In
toJson
, we are doing:Tasks
The text was updated successfully, but these errors were encountered: