Skip to content

feat(dps-dev): Add missing registration result fields#1313

Merged
timtay-microsoft merged 3 commits intomasterfrom
timtay/provisioningFix
Aug 18, 2021
Merged

feat(dps-dev): Add missing registration result fields#1313
timtay-microsoft merged 3 commits intomasterfrom
timtay/provisioningFix

Conversation

@timtay-microsoft
Copy link
Copy Markdown
Member

The service has sent these fields for a while, but we never exposed them to users for some reason. This brings our registration result class up to par with what the service sends to the SDK


import lombok.Getter;

public class ProvisioningDeviceClientRegistrationResult
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the public facing class that our provisioning device client returns to a user after a successful device registration. Previously, it only had the essential fields exposed, but now it exposes all the fields that the service gives us.

public enum ProvisioningDeviceClientSubstatus
{
/**
* Device has been assigned to an IoT hub for the first time
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These javadocs are copied directly from the service swagger

@timtay-microsoft
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

The service has sent these fields for a while, but we never exposed them to users for some reason. This brings our registration result class up to par with what the service sends to the SDK
@timtay-microsoft
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

Comment on lines +31 to +60

void setRegistrationId(String registrationId)
{
this.registrationId = registrationId;
}

void setCreatedDateTimeUtc(String createdDateTimeUtc)
{
this.createdDateTimeUtc = createdDateTimeUtc;
}

void setStatus(String status)
{
this.status = status;
}

void setSubstatus(ProvisioningDeviceClientSubstatus substatus)
{
this.substatus = substatus;
}

void setETag(String eTag)
{
this.eTag = eTag;
}

void setLastUpdatesDateTimeUtc(String lastUpdatesDateTimeUtc)
{
this.lastUpdatesDateTimeUtc = lastUpdatesDateTimeUtc;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason not to use Lombok? Might save us some code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The reason I'm not using lombok here is because the fields themselves are defined in the super class. I'd add some protected or package private lombok setters in the super class instead, but the setters are only used within this class's package, and it wouldn't make sense to publicly expose setters for this read-only class

…osoft/azure/sdk/iot/provisioning/device/ProvisioningDeviceClientSubstatus.java

Co-authored-by: jamdavi <73593426+jamdavi@users.noreply.github.com>
@timtay-microsoft
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

@timtay-microsoft timtay-microsoft merged commit e2afc21 into master Aug 18, 2021
@timtay-microsoft timtay-microsoft deleted the timtay/provisioningFix branch August 18, 2021 15:46
timtay-microsoft added a commit that referenced this pull request Aug 27, 2021
The service has sent these fields for a while, but we never exposed them to users for some reason. This brings our registration result class up to par with what the service sends to the SDK

Also add a small bug fix to a multiplexing client test
timtay-microsoft added a commit that referenced this pull request Aug 27, 2021
The service has sent these fields for a while, but we never exposed them to users for some reason. This brings our registration result class up to par with what the service sends to the SDK

Also add a small bug fix to a multiplexing client test
timtay-microsoft added a commit that referenced this pull request Aug 27, 2021
The service has sent these fields for a while, but we never exposed them to users for some reason. This brings our registration result class up to par with what the service sends to the SDK

Also add a small bug fix to a multiplexing client test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants