pdc-api 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pdc_api/__init__.py +37 -0
- pdc_api/_base.py +6 -0
- pdc_api/_generated.py +873 -0
- pdc_api/client.py +332 -0
- pdc_api/errors.py +61 -0
- pdc_api/models.py +136 -0
- pdc_api/permission_grants.py +307 -0
- pdc_api/py.typed +0 -0
- pdc_api/seeding/__init__.py +0 -0
- pdc_api/seeding/keycloak_admin.py +179 -0
- pdc_api/seeding/pdc_entities.py +711 -0
- pdc_api/testing.py +314 -0
- pdc_api/token.py +69 -0
- pdc_api/transport.py +100 -0
- pdc_api-0.4.1.dist-info/METADATA +276 -0
- pdc_api-0.4.1.dist-info/RECORD +18 -0
- pdc_api-0.4.1.dist-info/WHEEL +4 -0
- pdc_api-0.4.1.dist-info/licenses/LICENSE +661 -0
pdc_api/_generated.py
ADDED
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
# Generated by `just codegen` from src/pdc_api/openapi.json. Do not edit.
|
|
2
|
+
# generated by datamodel-codegen:
|
|
3
|
+
# filename: openapi.preprocessed.json
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from enum import StrEnum
|
|
8
|
+
from typing import Annotated, Any
|
|
9
|
+
from uuid import UUID
|
|
10
|
+
|
|
11
|
+
from pydantic import AwareDatetime, ConfigDict, Field, RootModel
|
|
12
|
+
|
|
13
|
+
from pdc_api._base import BaseSchema
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ApplicationFormFieldInputType(StrEnum):
|
|
17
|
+
SHORT_TEXT = "shortText"
|
|
18
|
+
LONG_TEXT = "longText"
|
|
19
|
+
RADIO = "radio"
|
|
20
|
+
DROPDOWN = "dropdown"
|
|
21
|
+
MULTISELECT = "multiselect"
|
|
22
|
+
HIDDEN = "hidden"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ApplicationFormFieldPatch(BaseSchema):
|
|
26
|
+
input_type: Annotated[
|
|
27
|
+
ApplicationFormFieldInputType | None,
|
|
28
|
+
Field(
|
|
29
|
+
alias="inputType",
|
|
30
|
+
description="A rendering hint for the UI indicating how the field should be displayed to the user.",
|
|
31
|
+
examples=["shortText"],
|
|
32
|
+
),
|
|
33
|
+
] = None
|
|
34
|
+
instructions: Annotated[
|
|
35
|
+
str | None,
|
|
36
|
+
Field(
|
|
37
|
+
description="Explicit instructions for the user to fill information into the form field.",
|
|
38
|
+
examples=["Please enter the full legal name of your organization."],
|
|
39
|
+
),
|
|
40
|
+
] = None
|
|
41
|
+
label: Annotated[str | None, Field(examples=["Your Organization Name"])] = None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class DataType(StrEnum):
|
|
45
|
+
STRING = "string"
|
|
46
|
+
NUMBER = "number"
|
|
47
|
+
EMAIL = "email"
|
|
48
|
+
PHONE_NUMBER = "phone_number"
|
|
49
|
+
URL = "url"
|
|
50
|
+
BOOLEAN = "boolean"
|
|
51
|
+
CURRENCY = "currency"
|
|
52
|
+
FILE = "file"
|
|
53
|
+
DATE = "date"
|
|
54
|
+
DATE_TIME = "date_time"
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class SensitivityClassification(StrEnum):
|
|
58
|
+
PUBLIC = "public"
|
|
59
|
+
RESTRICTED = "restricted"
|
|
60
|
+
FORBIDDEN = "forbidden"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class BaseFieldCategory(StrEnum):
|
|
64
|
+
PROJECT = "project"
|
|
65
|
+
ORGANIZATION = "organization"
|
|
66
|
+
NEEDS_ASSESSMENT = "needs_assessment"
|
|
67
|
+
METHODOLOGY = "methodology"
|
|
68
|
+
BUDGET = "budget"
|
|
69
|
+
EVALUATION = "evaluation"
|
|
70
|
+
SUSTAINABILITY = "sustainability"
|
|
71
|
+
PARTNERSHIPS = "partnerships"
|
|
72
|
+
OUTCOMES = "outcomes"
|
|
73
|
+
TECHNICAL = "technical"
|
|
74
|
+
UNCATEGORIZED = "uncategorized"
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class BaseFieldLocalization(BaseSchema):
|
|
78
|
+
base_field_short_code: Annotated[str, Field(alias="baseFieldShortCode", examples=["first_name"])]
|
|
79
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
80
|
+
description: Annotated[str, Field(examples=["The Name of the Applicant"])]
|
|
81
|
+
label: Annotated[str, Field(examples=["Applicant Name"])]
|
|
82
|
+
language: Annotated[str, Field(examples=["en"])]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class Status(StrEnum):
|
|
86
|
+
PENDING = "pending"
|
|
87
|
+
IN_PROGRESS = "in_progress"
|
|
88
|
+
COMPLETED = "completed"
|
|
89
|
+
FAILED = "failed"
|
|
90
|
+
CANCELED = "canceled"
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class BulkUploadLogDetails(BaseSchema):
|
|
94
|
+
model_config = ConfigDict(
|
|
95
|
+
extra="forbid",
|
|
96
|
+
)
|
|
97
|
+
cause: Annotated[
|
|
98
|
+
BulkUploadLogDetails | None, Field(description="A cause when available, another one of these objects.")
|
|
99
|
+
] = None
|
|
100
|
+
message: Annotated[str, Field(description="A message suitable for presentation to end users.")]
|
|
101
|
+
name: Annotated[str | None, Field(description="A name when available.")] = None
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class BulkUploadTaskLogDetails(RootModel[BulkUploadLogDetails]):
|
|
105
|
+
root: BulkUploadLogDetails
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class Bundle(BaseSchema):
|
|
109
|
+
total: Annotated[
|
|
110
|
+
int,
|
|
111
|
+
Field(
|
|
112
|
+
description="The total number of requested resources that exist in the database, across all pages.",
|
|
113
|
+
examples=[20],
|
|
114
|
+
),
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class EmptyObject(RootModel[dict[str, Any]]):
|
|
119
|
+
root: Annotated[dict[str, Any], Field(max_length=0, min_length=0)]
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class InvitationStatus(StrEnum):
|
|
123
|
+
PENDING = "pending"
|
|
124
|
+
ACCEPTED = "accepted"
|
|
125
|
+
REJECTED = "rejected"
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class InitiativePatch(BaseSchema):
|
|
129
|
+
model_config = ConfigDict(
|
|
130
|
+
extra="forbid",
|
|
131
|
+
)
|
|
132
|
+
title: Annotated[str | None, Field(examples=["Clean Water for the Upper Valley"], min_length=1)] = None
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class PdcError(BaseSchema):
|
|
136
|
+
details: list[Any] | None = []
|
|
137
|
+
message: str | None = None
|
|
138
|
+
name: str | None = None
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class Permission(StrEnum):
|
|
142
|
+
MANAGE = "manage"
|
|
143
|
+
EDIT = "edit"
|
|
144
|
+
VIEW = "view"
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class PermissionGrantEntityType(StrEnum):
|
|
148
|
+
FUNDER = "funder"
|
|
149
|
+
CHANGEMAKER = "changemaker"
|
|
150
|
+
DATA_PROVIDER = "dataProvider"
|
|
151
|
+
OPPORTUNITY = "opportunity"
|
|
152
|
+
PROPOSAL = "proposal"
|
|
153
|
+
PROPOSAL_VERSION = "proposalVersion"
|
|
154
|
+
APPLICATION_FORM = "applicationForm"
|
|
155
|
+
APPLICATION_FORM_FIELD = "applicationFormField"
|
|
156
|
+
PROPOSAL_FIELD_VALUE = "proposalFieldValue"
|
|
157
|
+
SOURCE = "source"
|
|
158
|
+
BULK_UPLOAD = "bulkUpload"
|
|
159
|
+
CHANGEMAKER_FIELD_VALUE = "changemakerFieldValue"
|
|
160
|
+
TERMINOLOGY_SET = "terminologySet"
|
|
161
|
+
INITIATIVE = "initiative"
|
|
162
|
+
INITIATIVE_FIELD_VALUE = "initiativeFieldValue"
|
|
163
|
+
ANY = "any"
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class PermissionGrantGranteeType(StrEnum):
|
|
167
|
+
USER = "user"
|
|
168
|
+
USER_GROUP = "userGroup"
|
|
169
|
+
AUTHENTICATED_USERS = "authenticatedUsers"
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class PermissionGrantVerb(StrEnum):
|
|
173
|
+
VIEW = "view"
|
|
174
|
+
CREATE = "create"
|
|
175
|
+
EDIT = "edit"
|
|
176
|
+
DELETE = "delete"
|
|
177
|
+
MANAGE = "manage"
|
|
178
|
+
REFERENCE = "reference"
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class PresignedPost(BaseSchema):
|
|
182
|
+
fields: dict[str, str]
|
|
183
|
+
url: str
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class S3Bucket(BaseSchema):
|
|
187
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt", examples=["2023-10-01T12:00:00.000Z"])]
|
|
188
|
+
endpoint: Annotated[str, Field(examples=["https://s3.us-east-1.amazonaws.com"])]
|
|
189
|
+
name: Annotated[str, Field(examples=["my-s3-bucket"])]
|
|
190
|
+
region: Annotated[str, Field(examples=["us-east-1"])]
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class SourcePatch(BaseSchema):
|
|
194
|
+
model_config = ConfigDict(
|
|
195
|
+
extra="forbid",
|
|
196
|
+
)
|
|
197
|
+
label: Annotated[
|
|
198
|
+
str | None,
|
|
199
|
+
Field(
|
|
200
|
+
description="A description of the dataset from the changemaker, funder, or data provider that adds the data to the PDC.",
|
|
201
|
+
examples=["The 2025 Survey of Changemakers by the Good Foundation"],
|
|
202
|
+
),
|
|
203
|
+
] = None
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class TerminologySetPatch(BaseSchema):
|
|
207
|
+
model_config = ConfigDict(
|
|
208
|
+
extra="forbid",
|
|
209
|
+
)
|
|
210
|
+
application_form_label: Annotated[str | None, Field(alias="applicationFormLabel", examples=["LOI Form"])] = None
|
|
211
|
+
application_forms_label: Annotated[str | None, Field(alias="applicationFormsLabel", examples=["LOI Forms"])] = None
|
|
212
|
+
name: Annotated[str | None, Field(examples=["LOI Vocabulary"], min_length=1)] = None
|
|
213
|
+
opportunities_label: Annotated[
|
|
214
|
+
str | None, Field(alias="opportunitiesLabel", examples=["Calls for Letters of Inquiry"])
|
|
215
|
+
] = None
|
|
216
|
+
opportunity_label: Annotated[
|
|
217
|
+
str | None, Field(alias="opportunityLabel", examples=["Call for Letters of Inquiry"])
|
|
218
|
+
] = None
|
|
219
|
+
proposal_label: Annotated[str | None, Field(alias="proposalLabel", examples=["Letter of Inquiry"])] = None
|
|
220
|
+
proposals_label: Annotated[str | None, Field(alias="proposalsLabel", examples=["Letters of Inquiry"])] = None
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class User(BaseSchema):
|
|
224
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
225
|
+
disabled_at: Annotated[
|
|
226
|
+
AwareDatetime | None,
|
|
227
|
+
Field(
|
|
228
|
+
alias="disabledAt",
|
|
229
|
+
description="The time this user was observed as absent from or not enabled in Keycloak by a sync; null if the user is still live in Keycloak. The user row is kept for referential integrity.",
|
|
230
|
+
),
|
|
231
|
+
] = None
|
|
232
|
+
keycloak_user_id: Annotated[UUID, Field(alias="keycloakUserId", examples=["550e8400-e29b-41d4-a716-446655440000"])]
|
|
233
|
+
keycloak_user_name: Annotated[
|
|
234
|
+
str | None,
|
|
235
|
+
Field(
|
|
236
|
+
alias="keycloakUserName",
|
|
237
|
+
description="The full name of the user (described in OIDC 1.0 'name' standard claim) as of the most recent logged-in service activity or Keycloak user sync.",
|
|
238
|
+
examples=["John Doe"],
|
|
239
|
+
),
|
|
240
|
+
] = None
|
|
241
|
+
synced_from_keycloak_at: Annotated[
|
|
242
|
+
AwareDatetime | None,
|
|
243
|
+
Field(
|
|
244
|
+
alias="syncedFromKeycloakAt",
|
|
245
|
+
description="The last time this row was confirmed against Keycloak by a sync; null until the first sync.",
|
|
246
|
+
),
|
|
247
|
+
] = None
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
class UserBundle(Bundle):
|
|
251
|
+
entries: Annotated[list[User], Field(description="The collection of requested resources.")]
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class Users(BaseSchema):
|
|
255
|
+
added: Annotated[int, Field(description="The number of users created in the local cache by the sync run.")]
|
|
256
|
+
disabled: Annotated[
|
|
257
|
+
int,
|
|
258
|
+
Field(
|
|
259
|
+
description="The number of local user rows marked disabled by the sync run because Keycloak reports them as absent or not enabled."
|
|
260
|
+
),
|
|
261
|
+
]
|
|
262
|
+
seen: Annotated[int, Field(description="The number of users found in Keycloak during the sync run.")]
|
|
263
|
+
updated: Annotated[
|
|
264
|
+
int, Field(description="The number of existing users confirmed against Keycloak by the sync run.")
|
|
265
|
+
]
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
class Details(BaseSchema):
|
|
269
|
+
users: Users
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class BaseField(BaseSchema):
|
|
273
|
+
category: BaseFieldCategory
|
|
274
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
275
|
+
data_type: Annotated[DataType, Field(alias="dataType", examples=["string"])]
|
|
276
|
+
description: Annotated[str, Field(examples=["The first name of the applicant"])]
|
|
277
|
+
label: Annotated[str, Field(examples=["First Name"])]
|
|
278
|
+
localizations: Annotated[
|
|
279
|
+
dict[str, BaseFieldLocalization] | None, Field(description="Keys can be expected to be IETF language tags.")
|
|
280
|
+
] = None
|
|
281
|
+
sensitivity_classification: Annotated[SensitivityClassification, Field(alias="sensitivityClassification")]
|
|
282
|
+
short_code: Annotated[str, Field(alias="shortCode", pattern="^[\\w\\-]+$")]
|
|
283
|
+
value_relevance_hours: Annotated[
|
|
284
|
+
int | None,
|
|
285
|
+
Field(
|
|
286
|
+
alias="valueRelevanceHours",
|
|
287
|
+
description="Duration (in hours) for which values of this base field are considered relevant.",
|
|
288
|
+
examples=[24],
|
|
289
|
+
ge=0,
|
|
290
|
+
),
|
|
291
|
+
]
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
class BaseFieldBundle(Bundle):
|
|
295
|
+
entries: Annotated[list[BaseField], Field(description="The collection of requested resources.")]
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
class BaseFieldLocalizationBundle(Bundle):
|
|
299
|
+
entries: Annotated[list[BaseFieldLocalization], Field(description="The collection of requested resources.")]
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
class BaseFieldsCopyTask(BaseSchema):
|
|
303
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
304
|
+
created_by: Annotated[
|
|
305
|
+
UUID,
|
|
306
|
+
Field(
|
|
307
|
+
alias="createdBy", description="The keycloak user id of the PDC user that created this BaseFieldCopyTask"
|
|
308
|
+
),
|
|
309
|
+
]
|
|
310
|
+
id: Annotated[int, Field(examples=[3407])]
|
|
311
|
+
pdc_api_url: Annotated[str, Field(alias="pdcApiUrl")]
|
|
312
|
+
status: Status
|
|
313
|
+
status_updated_at: Annotated[AwareDatetime, Field(alias="statusUpdatedAt")]
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class BaseFieldsCopyTaskBundle(Bundle):
|
|
317
|
+
entries: Annotated[list[BaseFieldsCopyTask], Field(description="The collection of requested resources.")]
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
class BulkUploadLog(BaseSchema):
|
|
321
|
+
model_config = ConfigDict(
|
|
322
|
+
extra="forbid",
|
|
323
|
+
)
|
|
324
|
+
bulk_upload_task_id: Annotated[int, Field(alias="bulkUploadTaskId")]
|
|
325
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
326
|
+
details: BulkUploadLogDetails
|
|
327
|
+
is_error: Annotated[
|
|
328
|
+
bool,
|
|
329
|
+
Field(alias="isError", description="True when this entry represents an error explaining a failed bulk upload."),
|
|
330
|
+
]
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
class BulkUploadTaskLog(RootModel[BulkUploadLog]):
|
|
334
|
+
root: BulkUploadLog
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
class DataProvider(BaseSchema):
|
|
338
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
339
|
+
created_by: Annotated[
|
|
340
|
+
UUID,
|
|
341
|
+
Field(alias="createdBy", description="The keycloak user id of the PDC user that created this data provider"),
|
|
342
|
+
]
|
|
343
|
+
keycloak_organization_id: Annotated[
|
|
344
|
+
UUID | None,
|
|
345
|
+
Field(
|
|
346
|
+
alias="keycloakOrganizationId",
|
|
347
|
+
description="If available, the PDC Keycloak Organization ID for this entity.",
|
|
348
|
+
),
|
|
349
|
+
]
|
|
350
|
+
name: Annotated[str, Field(examples=["Philanthropy Data Warehouse"])]
|
|
351
|
+
short_code: Annotated[str, Field(alias="shortCode", pattern="^[\\w\\-]+$")]
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
class DataProviderBundle(Bundle):
|
|
355
|
+
entries: Annotated[list[DataProvider], Field(description="The collection of requested resources.")]
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
class File(BaseSchema):
|
|
359
|
+
created_at: Annotated[AwareDatetime | None, Field(alias="createdAt", examples=["2023-10-01T12:00:00.000Z"])] = None
|
|
360
|
+
created_by: Annotated[UUID | None, Field(alias="createdBy", examples=["87654321-4321-4567-8901-210987654321"])] = (
|
|
361
|
+
None
|
|
362
|
+
)
|
|
363
|
+
download_url: Annotated[
|
|
364
|
+
str | None, Field(alias="downloadUrl", description="Presigned URL for downloading the file")
|
|
365
|
+
] = None
|
|
366
|
+
id: Annotated[int, Field(examples=[1])]
|
|
367
|
+
mime_type: Annotated[str | None, Field(alias="mimeType", examples=["application/pdf"])] = None
|
|
368
|
+
name: Annotated[str, Field(examples=["document.pdf"])]
|
|
369
|
+
presigned_post: Annotated[PresignedPost | None, Field(alias="presignedPost")] = None
|
|
370
|
+
s3_bucket: Annotated[S3Bucket | None, Field(alias="s3Bucket")] = None
|
|
371
|
+
s3_bucket_name: Annotated[str | None, Field(alias="s3BucketName", examples=["my-s3-bucket"])] = None
|
|
372
|
+
size: Annotated[int | None, Field(examples=[1024], ge=0)] = None
|
|
373
|
+
storage_key: Annotated[str | None, Field(alias="storageKey")] = None
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
class FileBundle(Bundle):
|
|
377
|
+
entries: Annotated[list[File], Field(description="The collection of requested resources.")]
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
class FiscalSponsorship(BaseSchema):
|
|
381
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
382
|
+
created_by: Annotated[
|
|
383
|
+
UUID,
|
|
384
|
+
Field(
|
|
385
|
+
alias="createdBy",
|
|
386
|
+
description="The keycloak user id of the PDC user that added this fiscal sponsorship record.",
|
|
387
|
+
),
|
|
388
|
+
]
|
|
389
|
+
fiscal_sponsee_changemaker_id: Annotated[int, Field(alias="fiscalSponseeChangemakerId", examples=[43])]
|
|
390
|
+
fiscal_sponsor_changemaker_id: Annotated[int, Field(alias="fiscalSponsorChangemakerId", examples=[42])]
|
|
391
|
+
not_after: Annotated[
|
|
392
|
+
AwareDatetime | None,
|
|
393
|
+
Field(
|
|
394
|
+
alias="notAfter",
|
|
395
|
+
description="For internal use. This will always be null in a response from this endpoint.",
|
|
396
|
+
examples=[None],
|
|
397
|
+
),
|
|
398
|
+
]
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class Funder(BaseSchema):
|
|
402
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
403
|
+
created_by: Annotated[
|
|
404
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this funder")
|
|
405
|
+
]
|
|
406
|
+
default_terminology_set_id: Annotated[
|
|
407
|
+
int | None,
|
|
408
|
+
Field(
|
|
409
|
+
alias="defaultTerminologySetId",
|
|
410
|
+
description="The funder's chosen default terminology set, exposed as a stored preference for clients to apply (for example, to pre-fill the terminology set when creating an opportunity). It is not applied automatically; an opportunity uses a terminology set only when one is explicitly set on it. Null means the funder has no chosen default.",
|
|
411
|
+
examples=[17],
|
|
412
|
+
),
|
|
413
|
+
] = None
|
|
414
|
+
is_collaborative: Annotated[bool, Field(alias="isCollaborative")]
|
|
415
|
+
keycloak_organization_id: Annotated[
|
|
416
|
+
UUID | None,
|
|
417
|
+
Field(
|
|
418
|
+
alias="keycloakOrganizationId",
|
|
419
|
+
description="If available, the PDC Keycloak Organization ID for this entity.",
|
|
420
|
+
),
|
|
421
|
+
] = None
|
|
422
|
+
name: Annotated[str, Field(examples=["Example Foundation"])]
|
|
423
|
+
permissions: dict[str, list[str]]
|
|
424
|
+
short_code: Annotated[str, Field(alias="shortCode", pattern="^[\\w\\-]+$")]
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
class FunderBundle(Bundle):
|
|
428
|
+
entries: Annotated[list[Funder], Field(description="The collection of requested resources.")]
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
class FunderCollaborativeInvitation(BaseSchema):
|
|
432
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
433
|
+
created_by: Annotated[
|
|
434
|
+
UUID,
|
|
435
|
+
Field(
|
|
436
|
+
alias="createdBy",
|
|
437
|
+
description="The keycloak user id of the PDC user that created this funder collaborative member",
|
|
438
|
+
),
|
|
439
|
+
]
|
|
440
|
+
funder_collaborative_short_code: Annotated[str, Field(alias="funderCollaborativeShortCode", pattern="^[\\w\\-]+$")]
|
|
441
|
+
invitation_status: Annotated[InvitationStatus, Field(alias="invitationStatus")]
|
|
442
|
+
invited_funder_short_code: Annotated[str, Field(alias="invitedFunderShortCode", pattern="^[\\w\\-]+$")]
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
class FunderCollaborativeInvitationBundle(Bundle):
|
|
446
|
+
entries: Annotated[list[FunderCollaborativeInvitation], Field(description="The collection of requested resources.")]
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
class FunderCollaborativeMember(BaseSchema):
|
|
450
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
451
|
+
created_by: Annotated[
|
|
452
|
+
UUID,
|
|
453
|
+
Field(
|
|
454
|
+
alias="createdBy",
|
|
455
|
+
description="The keycloak user id of the PDC user that created this funder collaborative member",
|
|
456
|
+
),
|
|
457
|
+
]
|
|
458
|
+
funder_collaborative_short_code: Annotated[str, Field(alias="funderCollaborativeShortCode", pattern="^[\\w\\-]+$")]
|
|
459
|
+
member_funder_short_code: Annotated[str, Field(alias="memberFunderShortCode", pattern="^[\\w\\-]+$")]
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
class FunderCollaborativeMemberBundle(Bundle):
|
|
463
|
+
entries: Annotated[list[FunderCollaborativeMember], Field(description="The collection of requested resources.")]
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
class Initiative(BaseSchema):
|
|
467
|
+
changemaker_id: Annotated[
|
|
468
|
+
int, Field(alias="changemakerId", description="The changemaker that leads this initiative.", examples=[7])
|
|
469
|
+
]
|
|
470
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
471
|
+
created_by: Annotated[
|
|
472
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this initiative")
|
|
473
|
+
]
|
|
474
|
+
id: Annotated[int, Field(examples=[42])]
|
|
475
|
+
title: Annotated[str, Field(examples=["Clean Water for the Lower Valley"], min_length=1)]
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
class InitiativeBundle(Bundle):
|
|
479
|
+
entries: Annotated[list[Initiative], Field(description="The collection of requested resources.")]
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
class InitiativeFieldValuePatch(BaseSchema):
|
|
483
|
+
model_config = ConfigDict(
|
|
484
|
+
extra="forbid",
|
|
485
|
+
)
|
|
486
|
+
good_as_of: Annotated[AwareDatetime | None, Field(alias="goodAsOf")] = None
|
|
487
|
+
source_id: Annotated[int | None, Field(alias="sourceId", examples=[7])] = None
|
|
488
|
+
value: Annotated[str | None, Field(examples=["A program that brings clean water to the upper valley."])] = None
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
class PartialChangemaker(BaseSchema):
|
|
492
|
+
keycloak_organization_id: Annotated[
|
|
493
|
+
UUID | None,
|
|
494
|
+
Field(
|
|
495
|
+
alias="keycloakOrganizationId",
|
|
496
|
+
description="If available, the PDC Keycloak Organization ID for this entity.",
|
|
497
|
+
),
|
|
498
|
+
] = None
|
|
499
|
+
name: Annotated[str | None, Field(examples=["Example Inc."])] = None
|
|
500
|
+
tax_id: Annotated[str | None, Field(alias="taxId", examples=["11-1111111"])] = None
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
class ProtectedChangemakerAttributes(BaseSchema):
|
|
504
|
+
created_at: Annotated[AwareDatetime | None, Field(alias="createdAt")] = None
|
|
505
|
+
created_by: Annotated[
|
|
506
|
+
UUID | None,
|
|
507
|
+
Field(alias="createdBy", description="The keycloak user id of the PDC user that created this changemaker"),
|
|
508
|
+
] = None
|
|
509
|
+
keycloak_organization_id: Annotated[
|
|
510
|
+
UUID | None,
|
|
511
|
+
Field(
|
|
512
|
+
alias="keycloakOrganizationId",
|
|
513
|
+
description="Optional, set this only when available. One can PATCH it in later if it becomes available.",
|
|
514
|
+
examples=[None, "9cb0cf25-0387-431a-8dc8-634f7f8768b9"],
|
|
515
|
+
),
|
|
516
|
+
] = None
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
class PublicChangemaker(BaseSchema):
|
|
520
|
+
id: Annotated[int, Field(examples=[3407])]
|
|
521
|
+
name: Annotated[str, Field(examples=["Example Inc."])]
|
|
522
|
+
tax_id: Annotated[str, Field(alias="taxId", examples=["11-1111111"])]
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
class ShallowChangemaker(PublicChangemaker, ProtectedChangemakerAttributes):
|
|
526
|
+
pass
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
class Source(BaseSchema):
|
|
530
|
+
changemaker: ShallowChangemaker | None = None
|
|
531
|
+
changemaker_id: Annotated[float | None, Field(alias="changemakerId")] = None
|
|
532
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
533
|
+
created_by: Annotated[UUID | None, Field(alias="createdBy")] = None
|
|
534
|
+
data_provider: Annotated[DataProvider | None, Field(alias="dataProvider")] = None
|
|
535
|
+
data_provider_short_code: Annotated[str | None, Field(alias="dataProviderShortCode")] = None
|
|
536
|
+
funder: Funder | None = None
|
|
537
|
+
funder_short_code: Annotated[str | None, Field(alias="funderShortCode")] = None
|
|
538
|
+
id: int
|
|
539
|
+
label: str
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
class SourceBundle(Bundle):
|
|
543
|
+
entries: Annotated[list[Source], Field(description="The collection of requested resources.")]
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
class TerminologySet(BaseSchema):
|
|
547
|
+
application_form_label: Annotated[
|
|
548
|
+
str | None,
|
|
549
|
+
Field(
|
|
550
|
+
alias="applicationFormLabel",
|
|
551
|
+
description="Singular display label for the canonical concept `applicationForm`.",
|
|
552
|
+
examples=["Intake Form"],
|
|
553
|
+
),
|
|
554
|
+
] = None
|
|
555
|
+
application_forms_label: Annotated[
|
|
556
|
+
str | None,
|
|
557
|
+
Field(
|
|
558
|
+
alias="applicationFormsLabel",
|
|
559
|
+
description="Plural display label for the canonical concept `applicationForm`.",
|
|
560
|
+
examples=["Intake Forms"],
|
|
561
|
+
),
|
|
562
|
+
] = None
|
|
563
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
564
|
+
created_by: Annotated[
|
|
565
|
+
UUID,
|
|
566
|
+
Field(alias="createdBy", description="The keycloak user id of the PDC user that created this terminology set"),
|
|
567
|
+
]
|
|
568
|
+
funder_short_code: Annotated[str, Field(alias="funderShortCode", examples=["pdc"])]
|
|
569
|
+
id: Annotated[int, Field(examples=[17])]
|
|
570
|
+
name: Annotated[str, Field(examples=["RFP Vocabulary"], min_length=1)]
|
|
571
|
+
opportunities_label: Annotated[
|
|
572
|
+
str | None,
|
|
573
|
+
Field(
|
|
574
|
+
alias="opportunitiesLabel",
|
|
575
|
+
description="Plural display label for the canonical concept `opportunity`.",
|
|
576
|
+
examples=["Requests for Proposal"],
|
|
577
|
+
),
|
|
578
|
+
] = None
|
|
579
|
+
opportunity_label: Annotated[
|
|
580
|
+
str | None,
|
|
581
|
+
Field(
|
|
582
|
+
alias="opportunityLabel",
|
|
583
|
+
description="Singular display label for the canonical concept `opportunity`. Null means use the PDC default.",
|
|
584
|
+
examples=["Request for Proposal"],
|
|
585
|
+
),
|
|
586
|
+
] = None
|
|
587
|
+
proposal_label: Annotated[
|
|
588
|
+
str | None,
|
|
589
|
+
Field(
|
|
590
|
+
alias="proposalLabel",
|
|
591
|
+
description="Singular display label for the canonical concept `proposal`.",
|
|
592
|
+
examples=["Funding Request"],
|
|
593
|
+
),
|
|
594
|
+
] = None
|
|
595
|
+
proposals_label: Annotated[
|
|
596
|
+
str | None,
|
|
597
|
+
Field(
|
|
598
|
+
alias="proposalsLabel",
|
|
599
|
+
description="Plural display label for the canonical concept `proposal`.",
|
|
600
|
+
examples=["Funding Requests"],
|
|
601
|
+
),
|
|
602
|
+
] = None
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
class TerminologySetBundle(Bundle):
|
|
606
|
+
entries: Annotated[list[TerminologySet], Field(description="The collection of requested resources.")]
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
class UserSyncTask(BaseSchema):
|
|
610
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
611
|
+
created_by: Annotated[
|
|
612
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that requested this sync.")
|
|
613
|
+
]
|
|
614
|
+
details: Annotated[
|
|
615
|
+
Details | None, Field(description="The summary of the completed sync run; null until the task completes.")
|
|
616
|
+
]
|
|
617
|
+
id: Annotated[int, Field(examples=[3407])]
|
|
618
|
+
status: Status
|
|
619
|
+
status_updated_at: Annotated[AwareDatetime, Field(alias="statusUpdatedAt")]
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
class ApplicationFormField(BaseSchema):
|
|
623
|
+
application_form_id: Annotated[int, Field(alias="applicationFormId", examples=[3529])]
|
|
624
|
+
base_field: Annotated[BaseField, Field(alias="baseField")]
|
|
625
|
+
base_field_short_code: Annotated[str, Field(alias="baseFieldShortCode", examples=["first_name"])]
|
|
626
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
627
|
+
id: Annotated[int, Field(examples=[3613])]
|
|
628
|
+
input_type: Annotated[
|
|
629
|
+
ApplicationFormFieldInputType | None,
|
|
630
|
+
Field(
|
|
631
|
+
alias="inputType",
|
|
632
|
+
description="A rendering hint for the UI indicating how the field should be displayed to the user.",
|
|
633
|
+
examples=["shortText"],
|
|
634
|
+
),
|
|
635
|
+
]
|
|
636
|
+
instructions: Annotated[
|
|
637
|
+
str | None,
|
|
638
|
+
Field(
|
|
639
|
+
description="Explicit instructions for the user to fill information into the form field.",
|
|
640
|
+
examples=["Please enter the first name of the applicant."],
|
|
641
|
+
),
|
|
642
|
+
]
|
|
643
|
+
label: Annotated[str, Field(examples=["Your First Name"])]
|
|
644
|
+
position: Annotated[int, Field(examples=[19])]
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
class ChangemakerFieldValueBatch(BaseSchema):
|
|
648
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
649
|
+
created_by: Annotated[UUID, Field(alias="createdBy")]
|
|
650
|
+
id: int
|
|
651
|
+
notes: Annotated[str | None, Field(examples=["Routine annual import"])]
|
|
652
|
+
source: Source
|
|
653
|
+
source_id: Annotated[int, Field(alias="sourceId")]
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
class ChangemakerFieldValueBatchBundle(Bundle):
|
|
657
|
+
entries: Annotated[list[ChangemakerFieldValueBatch], Field(description="The collection of requested resources.")]
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
class FieldValueBase(BaseSchema):
|
|
661
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
662
|
+
file: Annotated[
|
|
663
|
+
File | None,
|
|
664
|
+
Field(
|
|
665
|
+
description="For file fields, this contains the File object if the value is a valid file ID. Otherwise this property is null."
|
|
666
|
+
),
|
|
667
|
+
] = None
|
|
668
|
+
good_as_of: Annotated[AwareDatetime | None, Field(alias="goodAsOf")]
|
|
669
|
+
id: int
|
|
670
|
+
is_valid: Annotated[bool | None, Field(alias="isValid")]
|
|
671
|
+
value: str
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
class InitiativeFieldValue(FieldValueBase):
|
|
675
|
+
base_field: Annotated[BaseField, Field(alias="baseField")]
|
|
676
|
+
base_field_short_code: Annotated[
|
|
677
|
+
str, Field(alias="baseFieldShortCode", examples=["initiative_description"], pattern="^[\\w\\-]+$")
|
|
678
|
+
]
|
|
679
|
+
created_by: Annotated[
|
|
680
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this field value")
|
|
681
|
+
]
|
|
682
|
+
initiative_id: Annotated[
|
|
683
|
+
int,
|
|
684
|
+
Field(
|
|
685
|
+
alias="initiativeId",
|
|
686
|
+
description="The initiative this value describes. It is taken from the request path.",
|
|
687
|
+
examples=[42],
|
|
688
|
+
),
|
|
689
|
+
]
|
|
690
|
+
source: Source
|
|
691
|
+
source_id: Annotated[int, Field(alias="sourceId", description="The source that provided this value.", examples=[7])]
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
class InitiativeFieldValueBundle(Bundle):
|
|
695
|
+
entries: Annotated[list[InitiativeFieldValue], Field(description="The collection of requested resources.")]
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
class Opportunity(BaseSchema):
|
|
699
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
700
|
+
created_by: Annotated[
|
|
701
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this opportunity")
|
|
702
|
+
]
|
|
703
|
+
funder: Funder
|
|
704
|
+
funder_short_code: Annotated[str, Field(alias="funderShortCode", examples=["pdc"])]
|
|
705
|
+
id: Annotated[int, Field(examples=[3203])]
|
|
706
|
+
terminology_set: Annotated[
|
|
707
|
+
TerminologySet | None,
|
|
708
|
+
Field(
|
|
709
|
+
alias="terminologySet",
|
|
710
|
+
description="The bound terminology set, inlined only when the caller has `view | terminologySet` permission (directly or via the funder cascade). Null when no set is bound or when the caller lacks view permission; consult `terminologySetId` for the binding regardless.",
|
|
711
|
+
),
|
|
712
|
+
] = None
|
|
713
|
+
terminology_set_id: Annotated[
|
|
714
|
+
int | None,
|
|
715
|
+
Field(
|
|
716
|
+
alias="terminologySetId",
|
|
717
|
+
description="The terminology set whose label overrides apply to this opportunity. Null means use the PDC default labels. Must reference a terminology set owned by the same funder.",
|
|
718
|
+
),
|
|
719
|
+
] = None
|
|
720
|
+
title: Annotated[str, Field(examples=["The Open Source Foundation 2022 Challenge"])]
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
class OpportunityBundle(Bundle):
|
|
724
|
+
entries: Annotated[list[Opportunity], Field(description="The collection of requested resources.")]
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
class Organization(BaseSchema):
|
|
728
|
+
changemaker: ShallowChangemaker | None = None
|
|
729
|
+
data_provider: Annotated[DataProvider | None, Field(alias="dataProvider")] = None
|
|
730
|
+
funder: Funder | None = None
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
class ProposalFieldValue(FieldValueBase):
|
|
734
|
+
application_form_field: Annotated[ApplicationFormField, Field(alias="applicationFormField")]
|
|
735
|
+
application_form_field_id: Annotated[int, Field(alias="applicationFormFieldId", examples=[3613])]
|
|
736
|
+
position: Annotated[int, Field(examples=[23])]
|
|
737
|
+
proposal_id: Annotated[int, Field(alias="proposalId", examples=[2911])]
|
|
738
|
+
proposal_version_id: Annotated[int, Field(alias="proposalVersionId", examples=[3709])]
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
class ProposalVersion(BaseSchema):
|
|
742
|
+
application_form_id: Annotated[int, Field(alias="applicationFormId", examples=[3529])]
|
|
743
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
744
|
+
created_by: Annotated[
|
|
745
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this bulk upload")
|
|
746
|
+
]
|
|
747
|
+
field_values: Annotated[list[ProposalFieldValue], Field(alias="fieldValues")]
|
|
748
|
+
id: Annotated[int, Field(examples=[3821])]
|
|
749
|
+
proposal_id: Annotated[int, Field(alias="proposalId", examples=[3709])]
|
|
750
|
+
source: Source
|
|
751
|
+
source_id: Annotated[int, Field(alias="sourceId")]
|
|
752
|
+
version: Annotated[int, Field(examples=[17])]
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
class ApplicationForm(BaseSchema):
|
|
756
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
757
|
+
fields: list[ApplicationFormField]
|
|
758
|
+
id: Annotated[int, Field(examples=[3529])]
|
|
759
|
+
name: Annotated[str | None, Field(examples=["2025 Grant Application"])]
|
|
760
|
+
opportunity_id: Annotated[int, Field(alias="opportunityId", examples=[3203])]
|
|
761
|
+
version: Annotated[int, Field(examples=[13])]
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
class ApplicationFormBundle(Bundle):
|
|
765
|
+
entries: Annotated[list[ApplicationForm], Field(description="The collection of requested resources.")]
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
class BulkUploadTask(BaseSchema):
|
|
769
|
+
application_form: Annotated[ApplicationForm | None, Field(alias="applicationForm")] = None
|
|
770
|
+
application_form_id: Annotated[int, Field(alias="applicationFormId")]
|
|
771
|
+
attachments_archive_file: Annotated[File | None, Field(alias="attachmentsArchiveFile")] = None
|
|
772
|
+
attachments_archive_file_id: Annotated[int | None, Field(alias="attachmentsArchiveFileId")] = None
|
|
773
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
774
|
+
created_by: Annotated[
|
|
775
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this bulk upload")
|
|
776
|
+
]
|
|
777
|
+
created_by_user: Annotated[User, Field(alias="createdByUser")]
|
|
778
|
+
id: Annotated[int, Field(examples=[3407])]
|
|
779
|
+
logs: list[BulkUploadLog]
|
|
780
|
+
proposals_data_file: Annotated[File | None, Field(alias="proposalsDataFile")] = None
|
|
781
|
+
proposals_data_file_id: Annotated[int, Field(alias="proposalsDataFileId", examples=[123])]
|
|
782
|
+
source: Source | None = None
|
|
783
|
+
source_id: Annotated[int, Field(alias="sourceId")]
|
|
784
|
+
status: Status
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
class BulkUploadTaskBundle(Bundle):
|
|
788
|
+
entries: Annotated[list[BulkUploadTask], Field(description="The collection of requested resources.")]
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
class ChangemakerFieldValue(FieldValueBase):
|
|
792
|
+
base_field: Annotated[BaseField, Field(alias="baseField")]
|
|
793
|
+
base_field_short_code: Annotated[str, Field(alias="baseFieldShortCode", examples=["organization_mission"])]
|
|
794
|
+
batch: ChangemakerFieldValueBatch
|
|
795
|
+
batch_id: Annotated[int, Field(alias="batchId", examples=[456])]
|
|
796
|
+
changemaker_id: Annotated[int, Field(alias="changemakerId", examples=[123])]
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
class ChangemakerFieldValueBundle(Bundle):
|
|
800
|
+
entries: Annotated[list[ChangemakerFieldValue], Field(description="The collection of requested resources.")]
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
class Proposal(BaseSchema):
|
|
804
|
+
changemakers: Annotated[
|
|
805
|
+
list[ShallowChangemaker],
|
|
806
|
+
Field(
|
|
807
|
+
description="The changemakers associated with this proposal. Permission is evaluated per changemaker, so entries the caller cannot view carry only the public attributes while the rest carry all of them; a single array can hold both shapes."
|
|
808
|
+
),
|
|
809
|
+
]
|
|
810
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
811
|
+
created_by: Annotated[
|
|
812
|
+
UUID, Field(alias="createdBy", description="The keycloak user id of the PDC user that created this proposal")
|
|
813
|
+
]
|
|
814
|
+
external_id: Annotated[str, Field(alias="externalId", examples=["AnIdGeneratedByAGms"])]
|
|
815
|
+
id: Annotated[int, Field(examples=[3709])]
|
|
816
|
+
opportunity: Opportunity | None = None
|
|
817
|
+
opportunity_id: Annotated[int, Field(alias="opportunityId", examples=[3203])]
|
|
818
|
+
versions: list[ProposalVersion]
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
class ProposalBundle(Bundle):
|
|
822
|
+
entries: Annotated[list[Proposal], Field(description="The collection of requested resources.")]
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
class Changemaker(ShallowChangemaker):
|
|
826
|
+
fields: Annotated[
|
|
827
|
+
list[ProposalFieldValue | ChangemakerFieldValue],
|
|
828
|
+
Field(
|
|
829
|
+
description="For each base field, the best available value related to this changemaker. Can contain ProposalFieldValue or ChangemakerFieldValue objects. Empty when unauthenticated or when recursively querying changemakers, for example, within fiscal sponsors."
|
|
830
|
+
),
|
|
831
|
+
]
|
|
832
|
+
fiscal_sponsors: Annotated[
|
|
833
|
+
list[ShallowChangemaker] | None,
|
|
834
|
+
Field(
|
|
835
|
+
alias="fiscalSponsors",
|
|
836
|
+
description="Fiscal sponsors (past and present) of this changemaker. Omitted unless the caller holds `view` permission on this changemaker. Permission is evaluated per sponsor, so entries the caller cannot view carry only the public attributes while the rest carry all of them; a single array can hold both shapes. The entries never include values for `fields` nor `fiscalSponsors` to avoid infinite recursion. Use the returned `id` to call $getChangemakerById for those details.",
|
|
837
|
+
examples=[
|
|
838
|
+
[
|
|
839
|
+
{
|
|
840
|
+
"createdAt": "2025-02-07T13:16:16.191509-06:00",
|
|
841
|
+
"createdBy": "adace57c-25c2-40b1-9228-c48939f39f98",
|
|
842
|
+
"id": 74,
|
|
843
|
+
"keycloakOrganizationId": "f16a71f8-e67b-43ab-a258-31cd8a99a97a",
|
|
844
|
+
"name": "Community Development",
|
|
845
|
+
"taxId": "US123456789",
|
|
846
|
+
},
|
|
847
|
+
{"id": 92, "name": "Renewable Cities Initiative", "taxId": "US987654321"},
|
|
848
|
+
]
|
|
849
|
+
],
|
|
850
|
+
validate_default=True,
|
|
851
|
+
),
|
|
852
|
+
] = []
|
|
853
|
+
permissions: dict[str, list[str]]
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
class ChangemakerBundle(Bundle):
|
|
857
|
+
entries: Annotated[list[Changemaker], Field(description="The collection of requested resources.")]
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
class ChangemakerProposal(BaseSchema):
|
|
861
|
+
changemaker: Changemaker
|
|
862
|
+
changemaker_id: Annotated[int, Field(alias="changemakerId")]
|
|
863
|
+
created_at: Annotated[AwareDatetime, Field(alias="createdAt")]
|
|
864
|
+
id: int
|
|
865
|
+
proposal: Proposal
|
|
866
|
+
proposal_id: Annotated[int, Field(alias="proposalId")]
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
class ChangemakerProposalBundle(Bundle):
|
|
870
|
+
entries: Annotated[list[ChangemakerProposal], Field(description="The collection of requested resources.")]
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
BulkUploadLogDetails.model_rebuild()
|