Skip to content

Commit fd7d94e

Browse files
alianampcothenet
andauthored
Adds the highlights field to the projects response (#45)
* Adds highlights to project response * Run all of the things without python * Touch-up * Rerun makefile with new docker setup * Reran makefile to pull additional model changes * Add icon_url Co-authored-by: Paul Cothenet <pcothenet@gmail.com>
1 parent 0310e25 commit fd7d94e

File tree

9 files changed

+236
-4
lines changed

9 files changed

+236
-4
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.15.2] - 2021-11-08
9+
10+
### Added
11+
12+
- Adds highlights to project responses
13+
814
## [1.15.1] - 2021-11-04
915

1016
### Added

patch_api/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from __future__ import absolute_import
1717

18-
__version__ = "1.15.1"
18+
__version__ = "1.15.2"
1919

2020
# import ApiClient
2121
from patch_api.api_client import ApiClient

patch_api/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
self.default_headers[header_name] = header_value
9393
self.cookie = cookie
9494
# Set default User-Agent.
95-
self.user_agent = "patch-python/1.15.1"
95+
self.user_agent = "patch-python/1.15.2"
9696

9797
def __del__(self):
9898
if self._pool:

patch_api/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def to_debug_report(self):
341341
"OS: {env}\n"
342342
"Python Version: {pyversion}\n"
343343
"Version of the API: v1\n"
344-
"SDK Package Version: 1.15.1".format(
344+
"SDK Package Version: 1.15.2".format(
345345
env=sys.platform, pyversion=sys.version
346346
)
347347
)

patch_api/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from patch_api.models.estimate import Estimate
3838
from patch_api.models.estimate_list_response import EstimateListResponse
3939
from patch_api.models.estimate_response import EstimateResponse
40+
from patch_api.models.highlight import Highlight
4041
from patch_api.models.meta_index_object import MetaIndexObject
4142
from patch_api.models.order import Order
4243
from patch_api.models.order_list_response import OrderListResponse

patch_api/models/highlight.py

+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
# coding: utf-8
2+
3+
"""
4+
Patch API V1
5+
6+
The core API used to integrate with Patch's service # noqa: E501
7+
8+
The version of the OpenAPI document: v1
9+
Contact: developers@usepatch.com
10+
Generated by: https://openapi-generator.tech
11+
"""
12+
13+
14+
import pprint
15+
import re # noqa: F401
16+
17+
import six
18+
19+
from patch_api.configuration import Configuration
20+
21+
22+
class Highlight(object):
23+
"""NOTE: This class is auto generated by OpenAPI Generator.
24+
Ref: https://openapi-generator.tech
25+
26+
Do not edit the class manually.
27+
"""
28+
29+
"""
30+
Attributes:
31+
openapi_types (dict): The key is attribute name
32+
and the value is attribute type.
33+
attribute_map (dict): The key is attribute name
34+
and the value is json key in definition.
35+
"""
36+
openapi_types = {"slug": "str", "title": "str", "icon_url": "str"}
37+
38+
attribute_map = {"slug": "slug", "title": "title", "icon_url": "icon_url"}
39+
40+
def __init__(
41+
self, slug=None, title=None, icon_url=None, local_vars_configuration=None
42+
): # noqa: E501
43+
"""Highlight - a model defined in OpenAPI""" # noqa: E501
44+
if local_vars_configuration is None:
45+
local_vars_configuration = Configuration()
46+
self.local_vars_configuration = local_vars_configuration
47+
48+
self._slug = None
49+
self._title = None
50+
self._icon_url = None
51+
self.discriminator = None
52+
53+
self.slug = slug
54+
self.title = title
55+
self.icon_url = icon_url
56+
57+
@property
58+
def slug(self):
59+
"""Gets the slug of this Highlight. # noqa: E501
60+
61+
A unique identifier for each highlight. # noqa: E501
62+
63+
:return: The slug of this Highlight. # noqa: E501
64+
:rtype: str
65+
"""
66+
return self._slug
67+
68+
@slug.setter
69+
def slug(self, slug):
70+
"""Sets the slug of this Highlight.
71+
72+
A unique identifier for each highlight. # noqa: E501
73+
74+
:param slug: The slug of this Highlight. # noqa: E501
75+
:type: str
76+
"""
77+
if (
78+
self.local_vars_configuration.client_side_validation and slug is None
79+
): # noqa: E501
80+
raise ValueError(
81+
"Invalid value for `slug`, must not be `None`"
82+
) # noqa: E501
83+
84+
self._slug = slug
85+
86+
@property
87+
def title(self):
88+
"""Gets the title of this Highlight. # noqa: E501
89+
90+
A short string that spotlights a characteristic about the project. # noqa: E501
91+
92+
:return: The title of this Highlight. # noqa: E501
93+
:rtype: str
94+
"""
95+
return self._title
96+
97+
@title.setter
98+
def title(self, title):
99+
"""Sets the title of this Highlight.
100+
101+
A short string that spotlights a characteristic about the project. # noqa: E501
102+
103+
:param title: The title of this Highlight. # noqa: E501
104+
:type: str
105+
"""
106+
if (
107+
self.local_vars_configuration.client_side_validation and title is None
108+
): # noqa: E501
109+
raise ValueError(
110+
"Invalid value for `title`, must not be `None`"
111+
) # noqa: E501
112+
113+
self._title = title
114+
115+
@property
116+
def icon_url(self):
117+
"""Gets the icon_url of this Highlight. # noqa: E501
118+
119+
A URL for the corresponding icon. # noqa: E501
120+
121+
:return: The icon_url of this Highlight. # noqa: E501
122+
:rtype: str
123+
"""
124+
return self._icon_url
125+
126+
@icon_url.setter
127+
def icon_url(self, icon_url):
128+
"""Sets the icon_url of this Highlight.
129+
130+
A URL for the corresponding icon. # noqa: E501
131+
132+
:param icon_url: The icon_url of this Highlight. # noqa: E501
133+
:type: str
134+
"""
135+
if (
136+
self.local_vars_configuration.client_side_validation and icon_url is None
137+
): # noqa: E501
138+
raise ValueError(
139+
"Invalid value for `icon_url`, must not be `None`"
140+
) # noqa: E501
141+
142+
self._icon_url = icon_url
143+
144+
def to_dict(self):
145+
"""Returns the model properties as a dict"""
146+
result = {}
147+
148+
for attr, _ in six.iteritems(self.openapi_types):
149+
value = getattr(self, attr)
150+
if isinstance(value, list):
151+
result[attr] = list(
152+
map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)
153+
)
154+
elif hasattr(value, "to_dict"):
155+
result[attr] = value.to_dict()
156+
elif isinstance(value, dict):
157+
result[attr] = dict(
158+
map(
159+
lambda item: (item[0], item[1].to_dict())
160+
if hasattr(item[1], "to_dict")
161+
else item,
162+
value.items(),
163+
)
164+
)
165+
else:
166+
result[attr] = value
167+
168+
return result
169+
170+
def to_str(self):
171+
"""Returns the string representation of the model"""
172+
return pprint.pformat(self.to_dict())
173+
174+
def __repr__(self):
175+
"""For `print` and `pprint`"""
176+
return self.to_str()
177+
178+
def __eq__(self, other):
179+
"""Returns true if both objects are equal"""
180+
if not isinstance(other, Highlight):
181+
return False
182+
183+
return self.to_dict() == other.to_dict()
184+
185+
def __ne__(self, other):
186+
"""Returns true if both objects are not equal"""
187+
if not isinstance(other, Highlight):
188+
return True
189+
190+
return self.to_dict() != other.to_dict()

patch_api/models/project.py

+34
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class Project(object):
5353
"sdgs": "list[Sdg]",
5454
"tagline": "str",
5555
"technology_type": "TechnologyType",
56+
"highlights": "list[Highlight]",
5657
}
5758

5859
attribute_map = {
@@ -75,6 +76,7 @@ class Project(object):
7576
"sdgs": "sdgs",
7677
"tagline": "tagline",
7778
"technology_type": "technology_type",
79+
"highlights": "highlights",
7880
}
7981

8082
def __init__(
@@ -98,6 +100,7 @@ def __init__(
98100
sdgs=None,
99101
tagline=None,
100102
technology_type=None,
103+
highlights=None,
101104
local_vars_configuration=None,
102105
): # noqa: E501
103106
"""Project - a model defined in OpenAPI""" # noqa: E501
@@ -124,6 +127,7 @@ def __init__(
124127
self._sdgs = None
125128
self._tagline = None
126129
self._technology_type = None
130+
self._highlights = None
127131
self.discriminator = None
128132

129133
self.id = id
@@ -149,6 +153,7 @@ def __init__(
149153
if tagline is not None:
150154
self.tagline = tagline
151155
self.technology_type = technology_type
156+
self.highlights = highlights
152157

153158
@property
154159
def id(self):
@@ -650,6 +655,35 @@ def technology_type(self, technology_type):
650655

651656
self._technology_type = technology_type
652657

658+
@property
659+
def highlights(self):
660+
"""Gets the highlights of this Project. # noqa: E501
661+
662+
An array of objects containing the highlight's slug and title. A highlight's title is a short string that spotlights a characteristic about the project. # noqa: E501
663+
664+
:return: The highlights of this Project. # noqa: E501
665+
:rtype: list[Highlight]
666+
"""
667+
return self._highlights
668+
669+
@highlights.setter
670+
def highlights(self, highlights):
671+
"""Sets the highlights of this Project.
672+
673+
An array of objects containing the highlight's slug and title. A highlight's title is a short string that spotlights a characteristic about the project. # noqa: E501
674+
675+
:param highlights: The highlights of this Project. # noqa: E501
676+
:type: list[Highlight]
677+
"""
678+
if (
679+
self.local_vars_configuration.client_side_validation and highlights is None
680+
): # noqa: E501
681+
raise ValueError(
682+
"Invalid value for `highlights`, must not be `None`"
683+
) # noqa: E501
684+
685+
self._highlights = highlights
686+
653687
def to_dict(self):
654688
"""Returns the model properties as a dict"""
655689
result = {}

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from setuptools import setup, find_packages # noqa: H301
1313

1414
NAME = "patch-api"
15-
VERSION = "1.15.1"
15+
VERSION = "1.15.2"
1616
# To install the library, run the following
1717
#
1818
# python setup.py install

test/test_projects_api.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_retrieve_project(self):
4343
self.assertTrue(hasattr(project, "tagline"))
4444
self.assertTrue(hasattr(project, "latitude"))
4545
self.assertTrue(hasattr(project, "longitude"))
46+
self.assertTrue(hasattr(project, "highlights"))
4647

4748
self.assertTrue(isinstance(project.mechanism, str))
4849
self.assertTrue(isinstance(project.state, str))

0 commit comments

Comments
 (0)