Skip to content

Commit 37e0322

Browse files
committed
feat!: standardize attribute values to lowercase snake_case
1 parent 3fd5ca4 commit 37e0322

36 files changed

Lines changed: 73 additions & 73 deletions

src/didww/enums.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def to_enum_list(enum_cls, values):
2929

3030

3131
class CallbackMethod(str, Enum):
32-
POST = "POST"
33-
GET = "GET"
32+
POST = "post"
33+
GET = "get"
3434

3535

3636
class AddressVerificationStatus(str, Enum):
37-
PENDING = "Pending"
38-
APPROVED = "Approved"
39-
REJECTED = "Rejected"
37+
PENDING = "pending"
38+
APPROVED = "approved"
39+
REJECTED = "rejected"
4040

4141

4242
class ExportType(str, Enum):
@@ -45,21 +45,21 @@ class ExportType(str, Enum):
4545

4646

4747
class ExportStatus(str, Enum):
48-
PENDING = "Pending"
49-
PROCESSING = "Processing"
50-
COMPLETED = "Completed"
48+
PENDING = "pending"
49+
PROCESSING = "processing"
50+
COMPLETED = "completed"
5151

5252

5353
class IdentityType(str, Enum):
54-
PERSONAL = "Personal"
55-
BUSINESS = "Business"
56-
ANY = "Any"
54+
PERSONAL = "personal"
55+
BUSINESS = "business"
56+
ANY = "any"
5757

5858

5959
class OrderStatus(str, Enum):
60-
PENDING = "Pending"
61-
CANCELED = "Canceled"
62-
COMPLETED = "Completed"
60+
PENDING = "pending"
61+
CANCELED = "canceled"
62+
COMPLETED = "completed"
6363

6464

6565
class OnCliMismatchAction(str, Enum):
@@ -90,10 +90,10 @@ class EmergencyVerificationStatus(str, Enum):
9090
class EmergencyCallingServiceStatus(str, Enum):
9191
ACTIVE = "active"
9292
CANCELED = "canceled"
93-
CHANGES_REQUIRED = "changes required"
94-
IN_PROCESS = "in process"
93+
CHANGES_REQUIRED = "changes_required"
94+
IN_PROCESS = "in_process"
9595
NEW = "new"
96-
PENDING_UPDATE = "pending update"
96+
PENDING_UPDATE = "pending_update"
9797

9898

9999
class VoiceOutTrunkStatus(str, Enum):

tests/fixtures/address_requirements/show.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interactions:
1414
body:
1515
string: "{\n \"data\": {\n \"id\": \"25d12afe-1ec6-4fe3-9621-b250dd1fb959\"\
1616
,\n \"type\": \"address_requirements\",\n \"attributes\": {\n \"identity_type\"\
17-
: \"Any\",\n \"personal_area_level\": \"WorldWide\",\n \"business_area_level\"\
17+
: \"any\",\n \"personal_area_level\": \"WorldWide\",\n \"business_area_level\"\
1818
: \"WorldWide\",\n \"address_area_level\": \"WorldWide\",\n \"personal_proof_qty\"\
1919
: 1,\n \"business_proof_qty\": 1,\n \"address_proof_qty\": 1,\n\
2020
\ \"personal_mandatory_fields\": [\n \"Birth Date\",\n \
@@ -96,28 +96,28 @@ interactions:
9696
\ \"url\": \"https://sandbox-api.didww.com/storage/public/w7f2irbo819la7vd7up7u67pkmkn\"\
9797
\n }\n },\n {\n \"id\": \"19cd7b22-559b-41d4-99c9-7ad7ad63d5d1\"\
9898
,\n \"type\": \"proof_types\",\n \"attributes\": {\n \"name\"\
99-
: \"Drivers License\",\n \"entity_type\": \"Personal\"\n }\n \
99+
: \"Drivers License\",\n \"entity_type\": \"personal\"\n }\n \
100100
\ },\n {\n \"id\": \"af07842f-6339-46fe-83b6-57e457af1eaf\",\n \
101101
\ \"type\": \"proof_types\",\n \"attributes\": {\n \"name\"\
102102
: \"Business Registration Certificate / Incorporation Certificate\",\n \
103-
\ \"entity_type\": \"Business\"\n }\n },\n {\n \"id\"\
103+
\ \"entity_type\": \"business\"\n }\n },\n {\n \"id\"\
104104
: \"56b7d7cb-4d36-49c8-a786-2179967bba4c\",\n \"type\": \"proof_types\"\
105105
,\n \"attributes\": {\n \"name\": \"Trade License\",\n \
106-
\ \"entity_type\": \"Business\"\n }\n },\n {\n \"id\": \"\
106+
\ \"entity_type\": \"business\"\n }\n },\n {\n \"id\": \"\
107107
ecf699c6-b1ad-4866-974b-06d2e8a698e6\",\n \"type\": \"proof_types\",\n\
108108
\ \"attributes\": {\n \"name\": \"Excerpt from the commercial\
109-
\ register\",\n \"entity_type\": \"Business\"\n }\n },\n \
109+
\ register\",\n \"entity_type\": \"business\"\n }\n },\n \
110110
\ {\n \"id\": \"7f80edde-1b80-4410-af06-76a38ea9e576\",\n \"type\"\
111111
: \"proof_types\",\n \"attributes\": {\n \"name\": \"Other\",\n\
112-
\ \"entity_type\": \"Business\"\n }\n },\n {\n \"id\"\
112+
\ \"entity_type\": \"business\"\n }\n },\n {\n \"id\"\
113113
: \"80253913-cd8b-4ce2-91a9-9299587ac409\",\n \"type\": \"proof_types\"\
114114
,\n \"attributes\": {\n \"name\": \"Passport\",\n \"entity_type\"\
115-
: \"Business\"\n }\n },\n {\n \"id\": \"0eb83bb2-730c-45fb-b39c-c0bf02f88e9e\"\
115+
: \"business\"\n }\n },\n {\n \"id\": \"0eb83bb2-730c-45fb-b39c-c0bf02f88e9e\"\
116116
,\n \"type\": \"proof_types\",\n \"attributes\": {\n \"name\"\
117-
: \"National ID\",\n \"entity_type\": \"Business\"\n }\n },\n\
117+
: \"National ID\",\n \"entity_type\": \"business\"\n }\n },\n\
118118
\ {\n \"id\": \"1f3f4747-0835-44a4-9e5f-40e52ec4fce7\",\n \"\
119119
type\": \"proof_types\",\n \"attributes\": {\n \"name\": \"Drivers\
120-
\ License\",\n \"entity_type\": \"Business\"\n }\n },\n \
120+
\ License\",\n \"entity_type\": \"business\"\n }\n },\n \
121121
\ {\n \"id\": \"d2c1b3fb-29f7-46ca-ba82-b617f4630b78\",\n \"type\"\
122122
: \"proof_types\",\n \"attributes\": {\n \"name\": \"Copy of Phone\
123123
\ Bill\",\n \"entity_type\": \"Address\"\n }\n }\n ],\n \"\

tests/fixtures/address_verifications/create.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"type":"address_verifications","attributes":{"callback_url":"http://example.com","callback_method":"GET"},"relationships":{"address":{"data":{"type":"addresses","id":"d3414687-40f4-4346-a267-c2c65117d28c"}},"dids":{"data":[{"type":"dids","id":"a9d64c02-4486-4acb-a9a1-be4c81ff0659"}]}}}}'
3+
body: '{"data":{"type":"address_verifications","attributes":{"callback_url":"http://example.com","callback_method":"get"},"relationships":{"address":{"data":{"type":"addresses","id":"d3414687-40f4-4346-a267-c2c65117d28c"}},"dids":{"data":[{"type":"dids","id":"a9d64c02-4486-4acb-a9a1-be4c81ff0659"}]}}}}'
44
headers:
55
Accept:
66
- application/vnd.api+json
@@ -15,7 +15,7 @@ interactions:
1515
string: "{\n \"data\": {\n \"id\": \"78182ef2-8377-41cd-89e1-26e8266c9c94\"\
1616
,\n \"type\": \"address_verifications\",\n \"attributes\": {\n \
1717
\ \"service_description\": null,\n \"callback_url\": \"http://example.com\"\
18-
,\n \"callback_method\": \"GET\",\n \"status\": \"Pending\",\n \
18+
,\n \"callback_method\": \"get\",\n \"status\": \"pending\",\n \
1919
\ \"reject_reasons\": null,\n \"created_at\": \"2021-04-01T15:01:32.668Z\"\
2020
\n },\n \"relationships\": {\n \"dids\": {\n \"links\":\
2121
\ {\n \"self\": \"https://sandbox-api.didww.com/v3/address_verifications/78182ef2-8377-41cd-89e1-26e8266c9c94/relationships/dids\"\

tests/fixtures/address_verifications/list.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interactions:
1515
string: "{\n \"data\": [\n {\n \"id\": \"aaf2180a-3f2b-4427-888f-3d00f872014e\"\
1616
,\n \"type\": \"address_verifications\",\n \"attributes\": {\n \
1717
\ \"service_description\": null,\n \"callback_url\": \"http://example.com\"\
18-
,\n \"callback_method\": \"GET\",\n \"status\": \"Pending\"\
18+
,\n \"callback_method\": \"get\",\n \"status\": \"pending\"\
1919
,\n \"reject_reasons\": null,\n \"created_at\": \"2021-04-01T14:29:11.790Z\"\
2020
\n },\n \"relationships\": {\n \"dids\": {\n \"\
2121
links\": {\n \"self\": \"https://sandbox-api.didww.com/v3/address_verifications/aaf2180a-3f2b-4427-888f-3d00f872014e/relationships/dids\"\

tests/fixtures/address_verifications/show.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interactions:
1212
uri: https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e
1313
response:
1414
body:
15-
string: '{"data":{"id":"c8e004b0-87ec-4987-b4fb-ee89db099f0e","type":"address_verifications","attributes":{"service_description":null,"callback_url":null,"callback_method":null,"status":"Approved","reject_reasons":null,"created_at":"2020-09-15T06:38:12.650Z","reference":"SHB-485120"},"relationships":{"dids":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/relationships/dids","related":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/dids"}},"address":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/relationships/address","related":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/address"}}}},"meta":{"api_version":"2022-05-10"}}'
15+
string: '{"data":{"id":"c8e004b0-87ec-4987-b4fb-ee89db099f0e","type":"address_verifications","attributes":{"service_description":null,"callback_url":null,"callback_method":null,"status":"approved","reject_reasons":null,"created_at":"2020-09-15T06:38:12.650Z","reference":"SHB-485120"},"relationships":{"dids":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/relationships/dids","related":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/dids"}},"address":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/relationships/address","related":"https://sandbox-api.didww.com/v3/address_verifications/c8e004b0-87ec-4987-b4fb-ee89db099f0e/address"}}}},"meta":{"api_version":"2022-05-10"}}'
1616
headers:
1717
Content-Type:
1818
- application/vnd.api+json

tests/fixtures/address_verifications/show_rejected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interactions:
1212
uri: https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96
1313
response:
1414
body:
15-
string: '{"data":{"id":"429e6d4e-2ee9-4953-aa98-0b3ac07f0f96","type":"address_verifications","attributes":{"service_description":null,"callback_url":null,"callback_method":null,"status":"Rejected","reject_reasons":["Address cannot be validated","Proof of address should be not older than of 6 months"],"reference":"ODW-879912","created_at":"2020-10-28T08:29:29.960Z"},"relationships":{"dids":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/relationships/dids","related":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/dids"}},"address":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/relationships/address","related":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/address"}}}},"meta":{"api_version":"2022-05-10"}}'
15+
string: '{"data":{"id":"429e6d4e-2ee9-4953-aa98-0b3ac07f0f96","type":"address_verifications","attributes":{"service_description":null,"callback_url":null,"callback_method":null,"status":"rejected","reject_reasons":["Address cannot be validated","Proof of address should be not older than of 6 months"],"reference":"ODW-879912","created_at":"2020-10-28T08:29:29.960Z"},"relationships":{"dids":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/relationships/dids","related":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/dids"}},"address":{"links":{"self":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/relationships/address","related":"https://sandbox-api.didww.com/v3/address_verifications/429e6d4e-2ee9-4953-aa98-0b3ac07f0f96/address"}}}},"meta":{"api_version":"2022-05-10"}}'
1616
headers:
1717
Content-Type:
1818
- application/vnd.api+json

0 commit comments

Comments
 (0)