Skip to content

Commit f48d2e4

Browse files
committed
Add support for customMetaProperty options, include setup.py for local package usage
1 parent 7cd8ade commit f48d2e4

File tree

5 files changed

+53
-4
lines changed

5 files changed

+53
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Bootstrapped with [gql-generator](https://www.npmjs.com/package/gql-generator) t
66
The goal is to eventually publish this as a PyPI package, but it works just fine imported as a module for now.
77

88
# Usage
9+
## Local package installation (optional)
10+
To install the package in your environment, you can run `python setup.py install` and then `pip install frontify` which will allow you to use it as a regular import instead of importing the entire module.
11+
912
## Client
1013
Import and initialise the client as follows:
1114
```python

frontify/asyncFrontifyClient.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6566,8 +6566,22 @@ async def library(
65666566
modifiedAt
65676567
name
65686568
type {
6569-
__typename
6570-
name
6569+
... on CustomMetadataPropertyType {
6570+
__typename
6571+
name
6572+
... on CustomMetadataPropertyTypeSelect {
6573+
options {
6574+
id
6575+
value
6576+
}
6577+
}
6578+
... on CustomMetadataPropertyTypeMultiSelect{
6579+
options {
6580+
id
6581+
value
6582+
}
6583+
}
6584+
}
65716585
}
65726586
helpText
65736587
isRequired

frontify/frontifyClient.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6556,8 +6556,22 @@ def library(
65566556
modifiedAt
65576557
name
65586558
type {
6559-
__typename
6560-
name
6559+
... on CustomMetadataPropertyType {
6560+
__typename
6561+
name
6562+
... on CustomMetadataPropertyTypeSelect {
6563+
options {
6564+
id
6565+
value
6566+
}
6567+
}
6568+
... on CustomMetadataPropertyTypeMultiSelect{
6569+
options {
6570+
id
6571+
value
6572+
}
6573+
}
6574+
}
65616575
}
65626576
helpText
65636577
isRequired

frontify/library.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,12 @@ class LibraryLibraryCustomMetadataPropertiesType(BaseModel):
373373
"CustomMetadataPropertyTypeUrl",
374374
] = Field(alias="__typename")
375375
name: str
376+
options: Optional[List[Optional["LibraryLibraryCustomMetadataPropertiesTypeOptions"]]] = None
376377

378+
class LibraryLibraryCustomMetadataPropertiesTypeOptions(BaseModel):
379+
id: str
380+
value: str
381+
isDefault: Optional[bool] = None
377382

378383
Library.model_rebuild()
379384
LibraryLibrary.model_rebuild()

setup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='frontify',
5+
version='0.1',
6+
packages=find_packages(),
7+
install_requires=[
8+
'requests',
9+
'python-dotenv',
10+
'pydantic',
11+
'httpx',
12+
],
13+
)

0 commit comments

Comments
 (0)