Skip to content

Commit

Permalink
Merge pull request #86 from mjpieters/pyupgrade
Browse files Browse the repository at this point in the history
Remove Python 2.7 syntax and undeclared dependency
  • Loading branch information
volodymyrZotov authored Jan 3, 2024
2 parents 7ee0bb3 + 6c3faa0 commit bf1c6fa
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 69 deletions.
4 changes: 2 additions & 2 deletions example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time

import onepasswordconnectsdk
from onepasswordconnectsdk.models import (ItemVault, Field, GeneratorRecipe)
from onepasswordconnectsdk.models import Field, GeneratorRecipe, Item

op_connect_token = os.environ["OP_CONNECT_TOKEN"]
default_vault = os.environ["OP_VAULT"]
Expand All @@ -17,7 +17,7 @@
print(steps.steps["step1"])

# CREATE A NEW ITEM
username_item = onepasswordconnectsdk.models.Item(
username_item = Item(
title="Secret String",
category="LOGIN",
tags=["1password-connect"],
Expand Down
15 changes: 11 additions & 4 deletions src/onepasswordconnectsdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# coding: utf-8

# flake8: noqa

from onepasswordconnectsdk import client
from onepasswordconnectsdk import models
from onepasswordconnectsdk.config import load
from onepasswordconnectsdk.config import load_dict
from onepasswordconnectsdk.client import new_client
from onepasswordconnectsdk.client import new_client_from_environment

__all__ = [
"client",
"load",
"load_dict",
"models",
"new_client",
"new_client_from_environment"
]
1 change: 0 additions & 1 deletion src/onepasswordconnectsdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import List, Dict
from onepasswordconnectsdk.client import Client
from onepasswordconnectsdk.models import (
SummaryItem,
Item,
ParsedField,
ParsedItem,
Expand Down
24 changes: 17 additions & 7 deletions src/onepasswordconnectsdk/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# coding: utf-8

# flake8: noqa


from __future__ import absolute_import

# import models into model package
from onepasswordconnectsdk.models.error import Error
from onepasswordconnectsdk.models.item import Item
Expand All @@ -20,3 +13,20 @@
from onepasswordconnectsdk.models.parsed_field import ParsedField
from onepasswordconnectsdk.models.parsed_item import ParsedItem
from onepasswordconnectsdk.models.vault import Vault

__all__ = [
"Error",
"Field",
"FieldSection",
"File",
"GeneratorRecipe",
"Item",
"ItemDetails",
"ItemUrls",
"ItemVault",
"ParsedField",
"ParsedItem",
"Section",
"SummaryItem",
"Vault",
]
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/error.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class Error(object):
class Error:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
7 changes: 2 additions & 5 deletions src/onepasswordconnectsdk/models/field.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class Field(object):
class Field:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down Expand Up @@ -172,7 +169,7 @@ def purpose(self, purpose):
allowed_values = ["", "USERNAME", "PASSWORD", "NOTES"] # noqa: E501
if purpose not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `purpose` ({0}), must be one of {1}" # noqa: E501
"Invalid value for `purpose` ({}), must be one of {}" # noqa: E501
.format(purpose, allowed_values)
)

Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/field_section.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class FieldSection(object):
class FieldSection:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
3 changes: 1 addition & 2 deletions src/onepasswordconnectsdk/models/file.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pprint
import re # noqa: F401


class File(object):
class File:
openapi_types = {
'id': 'str',
'name': 'str',
Expand Down
15 changes: 4 additions & 11 deletions src/onepasswordconnectsdk/models/generator_recipe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,15 +9,10 @@
"""


try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
from inspect import getfullargspec
import pprint
import re # noqa: F401
import six

class GeneratorRecipe(object):
class GeneratorRecipe:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down Expand Up @@ -103,7 +96,7 @@ def character_sets(self, character_sets):
allowed_values = ["LETTERS", "DIGITS", "SYMBOLS"] # noqa: E501
if (not set(character_sets).issubset(set(allowed_values))): # noqa: E501
raise ValueError(
"Invalid values for `character_sets` [{0}], must be a subset of [{1}]" # noqa: E501
"Invalid values for `character_sets` [{}], must be a subset of [{}]" # noqa: E501
.format(", ".join(map(str, set(character_sets) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values)))
)
Expand All @@ -124,7 +117,7 @@ def convert(x):
else:
return x

for attr, _ in six.iteritems(self.openapi_types):
for attr in self.openapi_types:
value = getattr(self, attr)
attr = self.attribute_map.get(attr, attr) if serialize else attr
if isinstance(value, list):
Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/item.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class Item(object):
class Item:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/item_details.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class ItemDetails(object):
class ItemDetails:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/item_urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class ItemUrls(object):
class ItemUrls:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/item_vault.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class ItemVault(object):
class ItemVault:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/section.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class Section(object):
class Section:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
5 changes: 1 addition & 4 deletions src/onepasswordconnectsdk/models/summary_item.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,13 +9,12 @@


import pprint
import re # noqa: F401


from onepasswordconnectsdk.models import Item


class SummaryItem(object):
class SummaryItem:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down
7 changes: 2 additions & 5 deletions src/onepasswordconnectsdk/models/vault.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

"""
1Password Connect
Expand All @@ -11,10 +9,9 @@


import pprint
import re # noqa: F401


class Vault(object):
class Vault:
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down Expand Up @@ -237,7 +234,7 @@ def type(self, type):
allowed_values = ["USER_CREATED", "PERSONAL", "EVERYONE", "TRANSFER"] # noqa: E501
if type not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
"Invalid value for `type` ({}), must be one of {}" # noqa: E501
.format(type, allowed_values)
)

Expand Down

0 comments on commit bf1c6fa

Please sign in to comment.