Skip to content

Commit

Permalink
TERRAPI-27 Add assets_filters
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Jun 5, 2024
1 parent 2fb1de9 commit bea4a72
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 11 deletions.
1 change: 0 additions & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,4 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_self_info.py
tox.ini
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.5.0
7.6.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:

- API version: 2
- Package version: 1.0.0
- Generator version: 7.5.0
- Generator version: 7.6.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
1 change: 1 addition & 0 deletions docs/CatalogPublicationRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**subjects** | [**List[Subject]**](Subject.md) | Gets or sets the list of subjects to include in the metadata document. | [optional]
**collection** | **str** | Gets or sets the collection name where the metadata will be published. | [optional]
**depth** | **int** | Gets or sets the depth of the metadata to publish. 0 means no publication, 1 means the root metadata document only, 2 means the metadata document and its children, and so on. | [optional]
**assets_filters** | **List[str]** | | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/DataCastingRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Name | Type | Description | Notes
**depth** | **int** | | [optional]
**background_job_id** | **str** | | [optional]
**id** | **str** | | [optional]
**assets_filters** | **List[str]** | | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/IPublicationRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name | Type | Description | Notes
**subjects** | [**List[ISubject]**](ISubject.md) | | [optional] [readonly]
**collection** | **str** | | [optional] [readonly]
**depth** | **int** | | [optional] [readonly]
**assets_filters** | **List[str]** | | [optional] [readonly]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/PublicationRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Name | Type | Description | Notes
**publication_link** | [**List[Link]**](Link.md) | | [optional]
**context_id** | **str** | | [optional]
**properties** | **Dict[str, object]** | | [optional]
**assets_filters** | **List[str]** | | [optional]

## Example

Expand Down
3 changes: 3 additions & 0 deletions generate_code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

openapi-generator-cli generate -c config.yaml
11 changes: 9 additions & 2 deletions openapi_client/models/catalog_publication_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class CatalogPublicationRequest(BaseModel):
subjects: Optional[List[Subject]] = Field(default=None, description="Gets or sets the list of subjects to include in the metadata document.")
collection: Optional[StrictStr] = Field(default=None, description="Gets or sets the collection name where the metadata will be published.")
depth: Optional[StrictInt] = Field(default=None, description="Gets or sets the depth of the metadata to publish. 0 means no publication, 1 means the root metadata document only, 2 means the metadata document and its children, and so on.")
__properties: ClassVar[List[str]] = ["url", "catalog_id", "additional_links", "subjects", "collection", "depth"]
assets_filters: Optional[List[StrictStr]] = None
__properties: ClassVar[List[str]] = ["url", "catalog_id", "additional_links", "subjects", "collection", "depth", "assets_filters"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -110,6 +111,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.collection is None and "collection" in self.model_fields_set:
_dict['collection'] = None

# set to None if assets_filters (nullable) is None
# and model_fields_set contains the field
if self.assets_filters is None and "assets_filters" in self.model_fields_set:
_dict['assets_filters'] = None

return _dict

@classmethod
Expand All @@ -127,7 +133,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"additional_links": [Link.from_dict(_item) for _item in obj["additional_links"]] if obj.get("additional_links") is not None else None,
"subjects": [Subject.from_dict(_item) for _item in obj["subjects"]] if obj.get("subjects") is not None else None,
"collection": obj.get("collection"),
"depth": obj.get("depth")
"depth": obj.get("depth"),
"assets_filters": obj.get("assets_filters")
})
return _obj

Expand Down
11 changes: 9 additions & 2 deletions openapi_client/models/data_casting_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class DataCastingRequest(BaseModel):
depth: Optional[StrictInt] = None
background_job_id: Optional[StrictStr] = None
id: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["url", "catalog_id", "workspace_id", "processor_id", "additional_links", "subjects", "collection", "asset_filters", "path", "casting", "depth", "background_job_id", "id"]
assets_filters: Optional[List[StrictStr]] = None
__properties: ClassVar[List[str]] = ["url", "catalog_id", "workspace_id", "processor_id", "additional_links", "subjects", "collection", "asset_filters", "path", "casting", "depth", "background_job_id", "id", "assets_filters"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -133,6 +134,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.id is None and "id" in self.model_fields_set:
_dict['id'] = None

# set to None if assets_filters (nullable) is None
# and model_fields_set contains the field
if self.assets_filters is None and "assets_filters" in self.model_fields_set:
_dict['assets_filters'] = None

return _dict

@classmethod
Expand All @@ -157,7 +163,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"casting": obj.get("casting"),
"depth": obj.get("depth"),
"background_job_id": obj.get("background_job_id"),
"id": obj.get("id")
"id": obj.get("id"),
"assets_filters": obj.get("assets_filters")
})
return _obj

Expand Down
13 changes: 11 additions & 2 deletions openapi_client/models/i_publication_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class IPublicationRequest(BaseModel):
subjects: Optional[List[ISubject]] = None
collection: Optional[StrictStr] = None
depth: Optional[StrictInt] = None
__properties: ClassVar[List[str]] = ["id", "backgroundJobId", "url", "catalogId", "additionalLinks", "subjects", "collection", "depth"]
assets_filters: Optional[List[StrictStr]] = Field(default=None, alias="assetsFilters")
__properties: ClassVar[List[str]] = ["id", "backgroundJobId", "url", "catalogId", "additionalLinks", "subjects", "collection", "depth", "assetsFilters"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -76,6 +77,7 @@ def to_dict(self) -> Dict[str, Any]:
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
excluded_fields: Set[str] = set([
"id",
Expand All @@ -86,6 +88,7 @@ def to_dict(self) -> Dict[str, Any]:
"subjects",
"collection",
"depth",
"assets_filters",
])

_dict = self.model_dump(
Expand Down Expand Up @@ -142,6 +145,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.collection is None and "collection" in self.model_fields_set:
_dict['collection'] = None

# set to None if assets_filters (nullable) is None
# and model_fields_set contains the field
if self.assets_filters is None and "assets_filters" in self.model_fields_set:
_dict['assetsFilters'] = None

return _dict

@classmethod
Expand All @@ -161,7 +169,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"additionalLinks": [Link.from_dict(_item) for _item in obj["additionalLinks"]] if obj.get("additionalLinks") is not None else None,
"subjects": [ISubject.from_dict(_item) for _item in obj["subjects"]] if obj.get("subjects") is not None else None,
"collection": obj.get("collection"),
"depth": obj.get("depth")
"depth": obj.get("depth"),
"assetsFilters": obj.get("assetsFilters")
})
return _obj

Expand Down
11 changes: 9 additions & 2 deletions openapi_client/models/publication_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class PublicationRequest(BaseModel):
publication_link: Optional[List[Link]] = None
context_id: Optional[StrictStr] = None
properties: Optional[Dict[str, Any]] = None
__properties: ClassVar[List[str]] = ["id", "catalog_id", "token", "url", "additional_links", "subjects", "collection", "depth", "background_job_id", "publication_link", "context_id", "properties"]
assets_filters: Optional[List[StrictStr]] = None
__properties: ClassVar[List[str]] = ["id", "catalog_id", "token", "url", "additional_links", "subjects", "collection", "depth", "background_job_id", "publication_link", "context_id", "properties", "assets_filters"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -147,6 +148,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.properties is None and "properties" in self.model_fields_set:
_dict['properties'] = None

# set to None if assets_filters (nullable) is None
# and model_fields_set contains the field
if self.assets_filters is None and "assets_filters" in self.model_fields_set:
_dict['assets_filters'] = None

return _dict

@classmethod
Expand All @@ -170,7 +176,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"background_job_id": obj.get("background_job_id"),
"publication_link": [Link.from_dict(_item) for _item in obj["publication_link"]] if obj.get("publication_link") is not None else None,
"context_id": obj.get("context_id"),
"properties": obj.get("properties")
"properties": obj.get("properties"),
"assets_filters": obj.get("assets_filters")
})
return _obj

Expand Down

0 comments on commit bea4a72

Please sign in to comment.