Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
346 changes: 166 additions & 180 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ repository = "https://github.com/1Password/connect-sdk-python"
[tool.poetry.dependencies]
python = "^3.7"
requests = "^2.24.0"
six = "^1.10"
python-dateutil = "^2.8.1"

[tool.poetry.dev-dependencies]
pytest = "^6.0"
pytest-cov = "^3.0.0"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"

[build-system]
requires = ["poetry>=0.12"]
Expand Down
14 changes: 6 additions & 8 deletions src/onepasswordconnectsdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import os
import re
import six
import requests
import datetime
from requests.exceptions import HTTPError
Expand All @@ -16,10 +15,9 @@


class Client:
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
NATIVE_TYPES_MAPPING = {
"int": int,
"long": int if six.PY3 else long, # type: ignore # noqa: F821
"float": float,
"str": str,
"bool": bool,
Expand Down Expand Up @@ -443,13 +441,13 @@ def sanitize_for_serialization(self, obj):
# model definition for request.
obj_dict = {
obj.attribute_map[attr]: getattr(obj, attr)
for attr, _ in six.iteritems(obj.openapi_types)
for attr in obj.openapi_types.keys()
if getattr(obj, attr) is not None
}

return {
key: self.sanitize_for_serialization(val)
for key, val in six.iteritems(obj_dict)
for key, val in obj_dict.items()
}

def __deserialize(self, data, klass):
Expand All @@ -471,7 +469,7 @@ def __deserialize(self, data, klass):
if klass.startswith("dict("):
sub_kls = re.match(r"dict\(([^,]*), (.*)\)", klass).group(2)
return {
k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data) # noqa: E501
k: self.__deserialize(v, sub_kls) for k, v in data.items() # noqa: E501
}

# convert str to class
Expand Down Expand Up @@ -502,7 +500,7 @@ def __deserialize_primitive(self, data, klass):
try:
return klass(data)
except UnicodeEncodeError:
return six.text_type(data)
return str(data)
except TypeError:
return data

Expand Down Expand Up @@ -570,7 +568,7 @@ def __deserialize_model(self, data, klass):
and klass.openapi_types is not None
and isinstance(data, (list, dict))
):
for attr, attr_type in six.iteritems(klass.openapi_types):
for attr, attr_type in klass.openapi_types.items():
if klass.attribute_map[attr] in data:
value = data[klass.attribute_map[attr]]
kwargs[attr] = self.__deserialize(value, attr_type)
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class Error(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -94,7 +92,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class Field(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -290,7 +288,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/field_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class FieldSection(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -70,7 +68,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/file.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pprint
import re # noqa: F401

import six


class File(object):
openapi_types = {
Expand Down Expand Up @@ -71,7 +69,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class Item(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -406,7 +404,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class ItemDetails(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -96,7 +94,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/item_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class ItemUrls(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -96,7 +94,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/item_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class ItemVault(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -70,7 +68,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class Section(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -95,7 +93,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
3 changes: 1 addition & 2 deletions src/onepasswordconnectsdk/models/summary_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import pprint
import re # noqa: F401

import six

from onepasswordconnectsdk.models import Item

Expand Down Expand Up @@ -356,7 +355,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down
4 changes: 1 addition & 3 deletions src/onepasswordconnectsdk/models/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import pprint
import re # noqa: F401

import six


class Vault(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -291,7 +289,7 @@ def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types.keys():
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand Down