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-core, support systemData for Azure resource #18303

Conversation

weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Dec 22, 2020

@weidongxu-microsoft weidongxu-microsoft marked this pull request as draft January 11, 2021 03:24
@weidongxu-microsoft weidongxu-microsoft removed the request for review from xseeseesee February 25, 2021 07:08
@weidongxu-microsoft weidongxu-microsoft marked this pull request as ready for review February 25, 2021 07:13
Comment on lines 37 to 67
public CreatedByType createdByType() {
return this.createdByType;
}

/**
* Get the timestamp of resource creation (UTC).
*
* @return the timestamp of resource creation (UTC).
*/
public OffsetDateTime createdAt() {
return this.createdAt;
}

/**
* Get the identity that last modified the resource.
*
* @return the identity that last modified the resource.
*/
public String lastModifiedBy() {
return this.lastModifiedBy;
}

/**
* Get the type of identity that last modified the resource.
*
* @return the type of identity that last modified the resource.
*/
public CreatedByType lastModifiedByType() {
return this.lastModifiedByType;
}

Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Feb 25, 2021

Choose a reason for hiding this comment

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

@srnagar
Let me know if you have concern with the class name CreatedByType. It is defined by swagger. But it might be not very appropriate (as it is returned by createdByType() and lastModifiedByType(), more like IdentityType?).

However IdentityType would cause quite some naming conflicts with other swagger types (though not too bad as they are under different namespace).

Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Feb 25, 2021

Choose a reason for hiding this comment

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

Also appreciate suggestion on method names in SystemData. They seems a bit off (but I do not have better idea).

Copy link
Member

Choose a reason for hiding this comment

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

IdentityType sounds like a better name than CreatedByType as it is used for lastModifiedByType too.

Copy link
Member

Choose a reason for hiding this comment

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

SystemData seems very generic. Is this name finalized? Can we change this to AzureResourceSystemData?

Copy link
Member

Choose a reason for hiding this comment

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

The method names look fine but just want to check, do we prefix get for getter methods in other arm model types?

Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Feb 26, 2021

Choose a reason for hiding this comment

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

  1. Got it. Another candidate could be ResourceAuthorIdentityType.
  2. It is generic. The class is intended to be returned by every ARM resources (resource group, virtual network, disk, storage account, virtual machine, etc., well, all) in future. It is already in com.azure.core.management namespace. On the other hand from its name, it does seems belong to something of operating system (so far, I didn't find any existing SystemData class that going to be confused with this). Maybe ResourceSystemData would be better. Let me check e.g. how python or .NET names it.
  3. It is still used as POJO for ARM, so like Resource class, it does not have get prefix.

Comment on lines 37 to 67
public CreatedByType createdByType() {
return this.createdByType;
}

/**
* Get the timestamp of resource creation (UTC).
*
* @return the timestamp of resource creation (UTC).
*/
public OffsetDateTime createdAt() {
return this.createdAt;
}

/**
* Get the identity that last modified the resource.
*
* @return the identity that last modified the resource.
*/
public String lastModifiedBy() {
return this.lastModifiedBy;
}

/**
* Get the type of identity that last modified the resource.
*
* @return the type of identity that last modified the resource.
*/
public CreatedByType lastModifiedByType() {
return this.lastModifiedByType;
}

Copy link
Member

Choose a reason for hiding this comment

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

IdentityType sounds like a better name than CreatedByType as it is used for lastModifiedByType too.

Comment on lines 37 to 67
public CreatedByType createdByType() {
return this.createdByType;
}

/**
* Get the timestamp of resource creation (UTC).
*
* @return the timestamp of resource creation (UTC).
*/
public OffsetDateTime createdAt() {
return this.createdAt;
}

/**
* Get the identity that last modified the resource.
*
* @return the identity that last modified the resource.
*/
public String lastModifiedBy() {
return this.lastModifiedBy;
}

/**
* Get the type of identity that last modified the resource.
*
* @return the type of identity that last modified the resource.
*/
public CreatedByType lastModifiedByType() {
return this.lastModifiedByType;
}

Copy link
Member

Choose a reason for hiding this comment

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

SystemData seems very generic. Is this name finalized? Can we change this to AzureResourceSystemData?

Comment on lines 37 to 67
public CreatedByType createdByType() {
return this.createdByType;
}

/**
* Get the timestamp of resource creation (UTC).
*
* @return the timestamp of resource creation (UTC).
*/
public OffsetDateTime createdAt() {
return this.createdAt;
}

/**
* Get the identity that last modified the resource.
*
* @return the identity that last modified the resource.
*/
public String lastModifiedBy() {
return this.lastModifiedBy;
}

/**
* Get the type of identity that last modified the resource.
*
* @return the type of identity that last modified the resource.
*/
public CreatedByType lastModifiedByType() {
return this.lastModifiedByType;
}

Copy link
Member

Choose a reason for hiding this comment

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

The method names look fine but just want to check, do we prefix get for getter methods in other arm model types?

import java.time.OffsetDateTime;

/** Metadata pertaining to creation and last modification of the resource. */
public final class SystemData {
Copy link
Member

Choose a reason for hiding this comment

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

Is this type missing a constructor? How are the property values set?

Copy link
Member Author

Choose a reason for hiding this comment

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

The class is initialized by Jackson (via reflection), hence no constructor (or just default constructor). All properties is read-only, hence no setter.

@weidongxu-microsoft
Copy link
Member Author

So far:

  1. Name of SystemData is not changed
  2. Name of CreatedByType is changed to ResourceAuthorIdentityType

@weidongxu-microsoft weidongxu-microsoft merged commit f2f60f0 into Azure:master Mar 5, 2021
@weidongxu-microsoft weidongxu-microsoft deleted the mgmt-core_support-system-data branch March 5, 2021 04:23
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-java that referenced this pull request Mar 23, 2022
Updated the swagger files for fixing the casing issue (Azure#18303)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants