-
Notifications
You must be signed in to change notification settings - Fork 2k
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 core Region #14470
mgmt core Region #14470
Conversation
@srnagar Let me know if any feedback or recommendation. |
sdk/core/azure-core-management/src/main/java/com/azure/core/management/Region.java
Outdated
Show resolved
Hide resolved
sdk/core/azure-core-management/src/main/java/com/azure/core/management/Region.java
Show resolved
Hide resolved
sdk/core/azure-core-management/src/main/java/com/azure/core/management/Region.java
Show resolved
Hide resolved
*/ | ||
public static Region[] values() { | ||
Collection<Region> valuesCollection = VALUES_BY_NAME.values(); | ||
return valuesCollection.toArray(new Region[valuesCollection.size()]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not return the collection itself instead of converting it to array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is kind of emulate Enum public static T[] values()
.
Sure to change to Collection
(as https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core/src/main/java/com/azure/core/util/ExpandableStringEnum.java#L72-L74).
@@ -32,6 +32,7 @@ | |||
public static final Region CANADA_CENTRAL = new Region("canadacentral", "Canada Central"); | |||
public static final Region CANADA_EAST = new Region("canadaeast", "Canada East"); | |||
public static final Region BRAZIL_SOUTH = new Region("brazilsouth", "Brazil South"); | |||
public static final Region BRAZIL_SOUTHEAST = new Region("brazilsoutheast", "Brazil Southeast"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need another Region.java
in azure-resourcemanager-resources? Can this just use the one in azure-core-management
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add it in core-management, we will do the switch after next release.
Put Region to azure-core-management, which is to be shared across mgmt SDKs.
Region is common to all mgmt Azure resources.
https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#put-resource
I am not sure whether this be in root namespace or better be a nested namespace (
models
)?