mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 19:54:07 +00:00
Run black on utils
This commit is contained in:
@@ -13,20 +13,18 @@ from models.documents_common import DocumentVersion, LinkData
|
||||
|
||||
class DocumentUploadSessionInitialization(BaseModel):
|
||||
upload_ui_url: constr(min_length=1) = Field(
|
||||
description='A CDE UI URL for the client to open in a local browser. The user would enter document metadata '
|
||||
'directly in the CDE'
|
||||
)
|
||||
expires_in: int = Field(
|
||||
description='`upload_ui_url` expiry in seconds'
|
||||
description="A CDE UI URL for the client to open in a local browser. The user would enter document metadata "
|
||||
"directly in the CDE"
|
||||
)
|
||||
expires_in: int = Field(description="`upload_ui_url` expiry in seconds")
|
||||
max_size_in_bytes: int = Field(
|
||||
description='The maximum file size supported by the CDE. Attempts to upload a larger file will fail'
|
||||
description="The maximum file size supported by the CDE. Attempts to upload a larger file will fail"
|
||||
)
|
||||
|
||||
|
||||
class HttpMethod(Enum):
|
||||
POST = 'POST'
|
||||
PUT = 'PUT'
|
||||
POST = "POST"
|
||||
PUT = "PUT"
|
||||
|
||||
|
||||
class HeaderValue(BaseModel):
|
||||
@@ -40,12 +38,12 @@ class Headers(BaseModel):
|
||||
|
||||
class MultipartFormData(BaseModel):
|
||||
prefix: str = Field(
|
||||
description='This is a server provided value. Its value must be prefixed to the binary content body when '
|
||||
'uploading this part'
|
||||
description="This is a server provided value. Its value must be prefixed to the binary content body when "
|
||||
"uploading this part"
|
||||
)
|
||||
suffix: str = Field(
|
||||
description='This is a server provided value. Its value must be suffixed to the binary content body when '
|
||||
'uploading this part. Typically, this is the end boundary for a multipart/form-data request'
|
||||
description="This is a server provided value. Its value must be suffixed to the binary content body when "
|
||||
"uploading this part. Typically, this is the end boundary for a multipart/form-data request"
|
||||
)
|
||||
|
||||
|
||||
@@ -54,26 +52,22 @@ class UploadFilePartInstruction(BaseModel):
|
||||
http_method: HttpMethod
|
||||
additional_headers: Optional[Headers] = None
|
||||
include_authorization: Optional[bool] = Field(
|
||||
description='Whether or not to include the authorization request header in the file upload request. '
|
||||
'Including the authorization header with some cloud storage providers might fail the request'
|
||||
description="Whether or not to include the authorization request header in the file upload request. "
|
||||
"Including the authorization header with some cloud storage providers might fail the request"
|
||||
)
|
||||
multipart_form_data: Optional[MultipartFormData] = None
|
||||
content_range_start: int = Field(
|
||||
description='The inclusive, zero index based start for this part'
|
||||
)
|
||||
content_range_end: int = Field(
|
||||
description='The inclusive, zero index based end for this part'
|
||||
)
|
||||
content_range_start: int = Field(description="The inclusive, zero index based start for this part")
|
||||
content_range_end: int = Field(description="The inclusive, zero index based end for this part")
|
||||
|
||||
|
||||
class DocumentToUpload(BaseModel):
|
||||
session_file_id: constr(min_length=1) = Field(
|
||||
description='A client-provided identifier that allows matching the specification with the correct file on the '
|
||||
"user's machine"
|
||||
description="A client-provided identifier that allows matching the specification with the correct file on the "
|
||||
"user's machine"
|
||||
)
|
||||
upload_file_parts: List[UploadFilePartInstruction] = Field(
|
||||
description='An array of request specifications detailing how to split the file to parts and upload each part '
|
||||
'to the CDE'
|
||||
description="An array of request specifications detailing how to split the file to parts and upload each part "
|
||||
"to the CDE"
|
||||
# min_length=1,
|
||||
)
|
||||
upload_completion: LinkData
|
||||
@@ -83,8 +77,8 @@ class DocumentToUpload(BaseModel):
|
||||
class DocumentsToUpload(BaseModel):
|
||||
server_context: Optional[str] = Field(
|
||||
description="A CDE controlled identifier recording the user's context on the CDE. For example which project "
|
||||
'and folder the user was on. If the client provides the `server_context` in subsequent calls then '
|
||||
'the CDE will attemp to load the UI at the same place.'
|
||||
"and folder the user was on. If the client provides the `server_context` in subsequent calls then "
|
||||
"the CDE will attemp to load the UI at the same place."
|
||||
)
|
||||
documents_to_upload: Optional[List[DocumentToUpload]]
|
||||
|
||||
@@ -94,12 +88,10 @@ class DocumentsToUpload(BaseModel):
|
||||
|
||||
class DocumentDiscoverySessionInitialization(BaseModel):
|
||||
select_documents_url: constr(min_length=1) = Field(
|
||||
description='A CDE UI URL for the client to open in a local browser. The user would search and select '
|
||||
'documents directly in the CDE'
|
||||
)
|
||||
expires_in: int = Field(
|
||||
description='`select_documents_url` expiry in seconds'
|
||||
description="A CDE UI URL for the client to open in a local browser. The user would search and select "
|
||||
"documents directly in the CDE"
|
||||
)
|
||||
expires_in: int = Field(description="`select_documents_url` expiry in seconds")
|
||||
|
||||
|
||||
class DocumentsMarkedAsSelected(BaseModel):
|
||||
@@ -109,29 +101,25 @@ class DocumentsMarkedAsSelected(BaseModel):
|
||||
class SelectedDocuments(BaseModel):
|
||||
server_context: Optional[str] = Field(
|
||||
description="A CDE controlled identifier recording the user's context on the CDE. For example which project "
|
||||
'and folder the user was on. If the client provides the `server_context` in subsequent calls then '
|
||||
'the CDE will attemp to load the UI at the same place.'
|
||||
)
|
||||
documents: List[DocumentVersion] = Field(
|
||||
description='An array containing all the documents selected by the user'
|
||||
"and folder the user was on. If the client provides the `server_context` in subsequent calls then "
|
||||
"the CDE will attemp to load the UI at the same place."
|
||||
)
|
||||
documents: List[DocumentVersion] = Field(description="An array containing all the documents selected by the user")
|
||||
|
||||
|
||||
class DocumentMetadata(BaseModel):
|
||||
session_file_id: constr(min_length=1) = Field(
|
||||
description='This is a client provided id to differentiate between multiple files that are being uploaded in '
|
||||
'the same session'
|
||||
description="This is a client provided id to differentiate between multiple files that are being uploaded in "
|
||||
"the same session"
|
||||
)
|
||||
document_id: Optional[constr(min_length=1)] = Field(
|
||||
description='When present, indicates that this upload is a new version of an existing document'
|
||||
description="When present, indicates that this upload is a new version of an existing document"
|
||||
)
|
||||
version_number: constr(min_length=1) = Field(
|
||||
description='A human readable version number. This is not expected to be in any specific format across CDEs '
|
||||
'and may hold any value'
|
||||
)
|
||||
title: constr(min_length=1) = Field(
|
||||
description='A human readable code or identifier'
|
||||
description="A human readable version number. This is not expected to be in any specific format across CDEs "
|
||||
"and may hold any value"
|
||||
)
|
||||
title: constr(min_length=1) = Field(description="A human readable code or identifier")
|
||||
project: Optional[str]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user