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

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

Merged
merged 3 commits into from
Aug 18, 2021

Conversation

timtay-microsoft
Copy link
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

@@ -7,12 +7,33 @@

package com.microsoft.azure.sdk.iot.provisioning.device;

import lombok.Getter;

public class ProvisioningDeviceClientRegistrationResult
Copy link
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
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
Member Author

/azp run

@azure-pipelines
Copy link

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
Member Author

/azp run

@azure-pipelines
Copy link

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
Member

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
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
Member Author

/azp run

@azure-pipelines
Copy link

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