Skip to content

Commit

Permalink
Merge pull request #17 from blues/feat-openapi-update
Browse files Browse the repository at this point in the history
chore: add fleetUIDs param to provision project device req
  • Loading branch information
paigen11 authored Nov 14, 2024
2 parents f0f2e50 + 7197b68 commit 15c9e1b
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"packageName": "notehub_py",
"packageUrl": "https://github.com/blues/notehub-py",
"projectName": "notehub-py",
"packageVersion": "1.0.3"
"packageVersion": "1.0.4"
}
6 changes: 6 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,12 @@ paths:
device_sn:
type: string
description: The serial number to assign to the device.
fleet_uids:
type: array
items:
type: string
description: The fleetUIDs to provision the device to.
nullable: true
required:
- product_uid
responses:
Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The OpenAPI definition for the Notehub.io API.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.2.0
- Package version: 1.0.3
- Package version: 1.0.4
- Generator version: 7.5.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://dev.blues.io/support/](https://dev.blues.io/support/)
Expand Down
1 change: 1 addition & 0 deletions src/docs/PostProvisionProjectDeviceRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**product_uid** | **str** | The ProductUID that the device should use. |
**device_sn** | **str** | The serial number to assign to the device. | [optional]
**fleet_uids** | **List[str]** | The fleetUIDs to provision the device to. | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion src/notehub_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "1.0.3"
__version__ = "1.0.4"

# import apis into sdk package
from notehub_py.api.alert_api import AlertApi
Expand Down
2 changes: 1 addition & 1 deletion src/notehub_py/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/1.0.3/python'
self.user_agent = 'OpenAPI-Generator/1.0.4/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/notehub_py/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 1.2.0\n"\
"SDK Package Version: 1.0.3".\
"SDK Package Version: 1.0.4".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
11 changes: 9 additions & 2 deletions src/notehub_py/models/post_provision_project_device_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class PostProvisionProjectDeviceRequest(BaseModel):
""" # noqa: E501
product_uid: StrictStr = Field(description="The ProductUID that the device should use.")
device_sn: Optional[StrictStr] = Field(default=None, description="The serial number to assign to the device.")
__properties: ClassVar[List[str]] = ["product_uid", "device_sn"]
fleet_uids: Optional[List[StrictStr]] = Field(default=None, description="The fleetUIDs to provision the device to.")
__properties: ClassVar[List[str]] = ["product_uid", "device_sn", "fleet_uids"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -70,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if fleet_uids (nullable) is None
# and model_fields_set contains the field
if self.fleet_uids is None and "fleet_uids" in self.model_fields_set:
_dict['fleet_uids'] = None

return _dict

@classmethod
Expand All @@ -83,7 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate({
"product_uid": obj.get("product_uid"),
"device_sn": obj.get("device_sn")
"device_sn": obj.get("device_sn"),
"fleet_uids": obj.get("fleet_uids")
})
return _obj

Expand Down
2 changes: 1 addition & 1 deletion src/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "notehub_py"
version = "1.0.3"
version = "1.0.4"
description = "Notehub API"
authors = ["Blues Engineering <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "notehub-py"
VERSION = "1.0.3"
VERSION = "1.0.4"
PYTHON_REQUIRES = ">=3.7"
REQUIRES = [
"urllib3 >= 1.25.3, < 2.1.0",
Expand Down
5 changes: 4 additions & 1 deletion src/test/test_post_provision_project_device_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def make_instance(self, include_optional) -> PostProvisionProjectDeviceRequest:
if include_optional:
return PostProvisionProjectDeviceRequest(
product_uid = '',
device_sn = ''
device_sn = '',
fleet_uids = [
''
]
)
else:
return PostProvisionProjectDeviceRequest(
Expand Down

0 comments on commit 15c9e1b

Please sign in to comment.