Actually looking up data entry
This commit is contained in:
@@ -23,26 +23,150 @@ def get_bearer_token():
|
||||
|
||||
# Define the collection of request/response pairs
|
||||
# User can add more tuples following the same pattern
|
||||
SAMPLE_PROJECT_ID = 15905506
|
||||
SAMPLE_PROJECT_ID = 15974631
|
||||
SAMPLE_CLIENT_ID = 43407853
|
||||
SAMPLE_FOLDER_ID = 138954131
|
||||
SAMPLE_PROJECT_TYPE = 34111
|
||||
|
||||
REQUESTS = [
|
||||
(
|
||||
{
|
||||
"url": "https://api.filevineapp.com/fv-app/v2/projects",
|
||||
"headers": {
|
||||
"Accept": "application/json",
|
||||
"Authorization": f"Bearer {get_bearer_token()}",
|
||||
"x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
"x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
},
|
||||
"params": {},
|
||||
"method": "GET"
|
||||
# (
|
||||
# {
|
||||
# "url": "https://api.filevineapp.com/fv-app/v2/projects",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
},
|
||||
"examples/project_list.json"
|
||||
),
|
||||
# },
|
||||
# "examples/project_list.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/projects/{SAMPLE_PROJECT_ID}",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/project.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/Projects/{SAMPLE_PROJECT_ID}/contacts",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/project_contacts.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/contacts/{SAMPLE_CLIENT_ID}",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/client.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/folders/{SAMPLE_FOLDER_ID}",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/folder.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/folders/{SAMPLE_FOLDER_ID}/children",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/folder_children.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/DocumentSearch?projectId={SAMPLE_PROJECT_ID}&searchTerm=notice",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/document_search.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/ProjectTypes/{SAMPLE_PROJECT_TYPE}",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/project_type.json"
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "url": f"https://api.filevineapp.com/fv-app/v2/ProjectTypes/{SAMPLE_PROJECT_TYPE}/sections",
|
||||
# "headers": {
|
||||
# "Accept": "application/json",
|
||||
# "Authorization": f"Bearer {get_bearer_token()}",
|
||||
# "x-fv-orgid": os.environ.get("FILEVINE_ORG_ID"),
|
||||
# "x-fv-userid": os.environ.get("FILEVINE_USER_ID"),
|
||||
# },
|
||||
# "params": {},
|
||||
# "method": "GET"
|
||||
|
||||
# },
|
||||
# "examples/project_type_sections.json"
|
||||
# ),
|
||||
(
|
||||
{
|
||||
"url": f"https://api.filevineapp.com/fv-app/v2/Projects/{SAMPLE_PROJECT_ID}/contacts",
|
||||
"url": f"https://api.filevineapp.com/fv-app/v2/Projects/{SAMPLE_PROJECT_ID}/Forms/complaintInfo",
|
||||
"headers": {
|
||||
"Accept": "application/json",
|
||||
"Authorization": f"Bearer {get_bearer_token()}",
|
||||
@@ -53,11 +177,11 @@ REQUESTS = [
|
||||
"method": "GET"
|
||||
|
||||
},
|
||||
"examples/project_contacts.json"
|
||||
"examples/forms__complaintInfo.json"
|
||||
),
|
||||
(
|
||||
{
|
||||
"url": f"https://api.filevineapp.com/fv-app/v2/contacts/43125866",
|
||||
"url": f"https://api.filevineapp.com/fv-app/v2/Projects/{SAMPLE_PROJECT_ID}/Forms/newFileReview",
|
||||
"headers": {
|
||||
"Accept": "application/json",
|
||||
"Authorization": f"Bearer {get_bearer_token()}",
|
||||
@@ -68,8 +192,8 @@ REQUESTS = [
|
||||
"method": "GET"
|
||||
|
||||
},
|
||||
"examples/client.json"
|
||||
)
|
||||
"examples/forms__newFileReview.json"
|
||||
)
|
||||
]
|
||||
|
||||
def generate_sample_request_response(request_config):
|
||||
@@ -83,6 +207,7 @@ def generate_sample_request_response(request_config):
|
||||
"sample_response": {
|
||||
"status_code": response.status_code,
|
||||
"json": response.json() if response.content else None,
|
||||
"xxx": str(response.content),
|
||||
"headers": dict(response.headers)
|
||||
}
|
||||
}
|
||||
@@ -108,4 +233,4 @@ if __name__ == "__main__":
|
||||
print(f"Generated {len(REQUESTS)} sample request/response pairs")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
print(f"Error: {e}")
|
||||
|
||||
Reference in New Issue
Block a user