smartcar / java-sdk

Java client SDK for the Smartcar API.
https://smartcar.github.io/java-sdk
MIT License
20 stars 20 forks source link

feat: get VehicleLockStatus #133

Closed naomiperez closed 1 year ago

naomiperez commented 1 year ago

This PR will add support for getting the lock status of a vehicle.

We create a new method in the Vehicle class called lockStatus() that will return a VehicleLockStatus object containing a property isLocked (true if vehicle is locked), and arrays of

each of which have a type and status.

Asana: https://app.asana.com/0/1205281929337658/1205139255747896/f

codecov[bot] commented 1 year ago

Codecov Report

Merging #133 (99bc61d) into master (8158ae5) will decrease coverage by 0.20%. The diff coverage is 68.57%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/smartcar/java-sdk/pull/133/graphs/tree.svg?width=650&height=150&src=pr&token=nZAITx7w3X&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar)](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) ```diff @@ Coverage Diff @@ ## master #133 +/- ## ============================================ - Coverage 73.93% 73.74% -0.20% - Complexity 221 245 +24 ============================================ Files 44 50 +6 Lines 940 975 +35 Branches 69 69 ============================================ + Hits 695 719 +24 - Misses 204 215 +11 Partials 41 41 ``` | [Flag](https://app.codecov.io/gh/smartcar/java-sdk/pull/133/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/smartcar/java-sdk/pull/133/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) | `60.20% <0.00%> (-2.25%)` | :arrow_down: | | [test](https://app.codecov.io/gh/smartcar/java-sdk/pull/133/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) | `46.66% <68.57%> (+0.81%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) | Coverage Δ | | |---|---|---| | [.../java/com/smartcar/sdk/data/VehicleLockStatus.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZUxvY2tTdGF0dXMuamF2YQ==) | `53.84% <53.84%> (ø)` | | | [...ava/com/smartcar/sdk/data/VehicleChargingPort.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZUNoYXJnaW5nUG9ydC5qYXZh) | `75.00% <75.00%> (ø)` | | | [...c/main/java/com/smartcar/sdk/data/VehicleDoor.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZURvb3IuamF2YQ==) | `75.00% <75.00%> (ø)` | | | [...ain/java/com/smartcar/sdk/data/VehicleStorage.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZVN0b3JhZ2UuamF2YQ==) | `75.00% <75.00%> (ø)` | | | [...ain/java/com/smartcar/sdk/data/VehicleSunroof.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZVN1bnJvb2YuamF2YQ==) | `75.00% <75.00%> (ø)` | | | [...main/java/com/smartcar/sdk/data/VehicleWindow.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZVdpbmRvdy5qYXZh) | `75.00% <75.00%> (ø)` | | | [src/main/java/com/smartcar/sdk/Vehicle.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL1ZlaGljbGUuamF2YQ==) | `96.03% <100.00%> (+0.03%)` | :arrow_up: | | [...main/java/com/smartcar/sdk/data/BatchResponse.java](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvQmF0Y2hSZXNwb25zZS5qYXZh) | `97.77% <100.00%> (+0.05%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar). Last update [8158ae5...99bc61d](https://app.codecov.io/gh/smartcar/java-sdk/pull/133?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar).
wikiadrian commented 1 year ago

The question about having a parent class with type and status. I think this depends of the level of abstraction we are doing. When I specced the tickets I tried to come up with a generic class that wraps all the concepts but none of the components share any other attribute or a term in common. The only shared the openability status and all belong to a car, the former is more a composition relation.

JacobAndrewSmith92 commented 1 year ago

The question about having a parent class with type and status. I think this depends of the level of abstraction we are doing. When I specced the tickets I tried to come up with a generic class that wraps all the concepts but none of the components share any other attribute or a term in common. The only shared the openability status and all belong to a car, the former is more a composition relation.

Makes sense. Yeah, I was alluding to a composition type implementation when I was thinking about it. I think it doesn't really matter here. Just wanted to discuss. I like your reasoning.