Skip to content

Commit

Permalink
#3 Completed CategoryResponseApi and incorporation of data models fo…
Browse files Browse the repository at this point in the history
…r geometry, event, source etc.
  • Loading branch information
sunayana committed Aug 29, 2021
1 parent c5fb3dc commit 2553f30
Show file tree
Hide file tree
Showing 11 changed files with 1,118 additions and 4 deletions.
8 changes: 7 additions & 1 deletion apps/retrieve_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@

def main():
api = DefaultApi()
# Example 1: Obtain wildfire response object
wildfire_response: CategoryResponse = api.categories_category_id_get("wildfires")

# Example 2: Obtain wildfire response object from a specific source
wildfire_response_source: CategoryResponse = api.categories_category_id_get(
"wildfires", source="InciWeb"
)
# Example 3:
print(wildfire_response)
print(wildfire_response_source._description)


if __name__ == "__main__":
Expand Down
7 changes: 7 additions & 0 deletions swagger_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
# import models into sdk package
from swagger_client.models.category import Category
from swagger_client.models.category_response import CategoryResponse
from swagger_client.models.event import Event
from swagger_client.models.geometry import Geometry
from swagger_client.models.one_of_category_response_events_items import OneOfCategoryResponseEventsItems
from swagger_client.models.one_of_event_categories_items import OneOfEventCategoriesItems
from swagger_client.models.one_of_event_geometry_items import OneOfEventGeometryItems
from swagger_client.models.one_of_event_sources_items import OneOfEventSourcesItems
from swagger_client.models.source import Source
7 changes: 7 additions & 0 deletions swagger_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@
# import models into model package
from swagger_client.models.category import Category
from swagger_client.models.category_response import CategoryResponse
from swagger_client.models.event import Event
from swagger_client.models.geometry import Geometry
from swagger_client.models.one_of_category_response_events_items import OneOfCategoryResponseEventsItems
from swagger_client.models.one_of_event_categories_items import OneOfEventCategoriesItems
from swagger_client.models.one_of_event_geometry_items import OneOfEventGeometryItems
from swagger_client.models.one_of_event_sources_items import OneOfEventSourcesItems
from swagger_client.models.source import Source
34 changes: 31 additions & 3 deletions swagger_client/models/category_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,32 @@ class CategoryResponse(object):
swagger_types = {
'title': 'str',
'description': 'str',
'link': 'str'
'link': 'str',
'events': 'list[OneOfCategoryResponseEventsItems]'
}

attribute_map = {
'title': 'title',
'description': 'description',
'link': 'link'
'link': 'link',
'events': 'events'
}

def __init__(self, title=None, description=None, link=None): # noqa: E501
def __init__(self, title=None, description=None, link=None, events=None): # noqa: E501
"""CategoryResponse - a model defined in Swagger""" # noqa: E501
self._title = None
self._description = None
self._link = None
self._events = None
self.discriminator = None
if title is not None:
self.title = title
if description is not None:
self.description = description
if link is not None:
self.link = link
if events is not None:
self.events = events

@property
def title(self):
Expand Down Expand Up @@ -115,6 +120,29 @@ def link(self, link):

self._link = link

@property
def events(self):
"""Gets the events of this CategoryResponse. # noqa: E501
An array of events. # noqa: E501
:return: The events of this CategoryResponse. # noqa: E501
:rtype: list[OneOfCategoryResponseEventsItems]
"""
return self._events

@events.setter
def events(self, events):
"""Sets the events of this CategoryResponse.
An array of events. # noqa: E501
:param events: The events of this CategoryResponse. # noqa: E501
:type: list[OneOfCategoryResponseEventsItems]
"""

self._events = events

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
Loading

0 comments on commit 2553f30

Please sign in to comment.