Skip to content

Commit 5a1f71d

Browse files
committed
feat!: standardize attribute values to lowercase snake_case
1 parent 7abe309 commit 5a1f71d

37 files changed

Lines changed: 93 additions & 93 deletions

src/didww/enums.py

Lines changed: 21 additions & 21 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):
@@ -108,10 +108,10 @@ class CliFormat(str, Enum):
108108

109109

110110
class AreaLevel(str, Enum):
111-
WORLDWIDE = "WorldWide"
112-
COUNTRY = "Country"
113-
AREA = "Area"
114-
CITY = "City"
111+
WORLDWIDE = "world_wide"
112+
COUNTRY = "country"
113+
AREA = "area"
114+
CITY = "city"
115115

116116

117117
class Feature(str, Enum):

tests/fixtures/address_requirements/list.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ interactions:
1414
body:
1515
string: "{\n \"data\": [\n {\n \"id\": \"b6c80acb-3952-4d53-9e62-fe2348c0636b\"\
1616
,\n \"type\": \"address_requirements\",\n \"attributes\": {\n \"\
17-
identity_type\": \"Any\",\n \"personal_area_level\": \"Country\",\n\
18-
\ \"business_area_level\": \"WorldWide\",\n \"address_area_level\"\
17+
identity_type\": \"Any\",\n \"personal_area_level\": \"country\",\n\
18+
\ \"business_area_level\": \"world_wide\",\n \"address_area_level\"\
1919
: \"Area\",\n \"personal_proof_qty\": 1,\n \"business_proof_qty\"\
2020
: 2,\n \"address_proof_qty\": 1,\n \"personal_mandatory_fields\"\
2121
: [\n \"Country\"\n ],\n \"business_mandatory_fields\"\
@@ -50,8 +50,8 @@ interactions:
5050
,\n \"related\": \"https://sandbox-api.didww.com/v3/address_requirements/b6c80acb-3952-4d53-9e62-fe2348c0636b/address_proof_types\"\
5151
\n }\n }\n }\n },\n {\n \"id\": \"51b293af-a496-4bf2-9c68-5221b3b0dc1e\"\
5252
,\n \"type\": \"address_requirements\",\n \"attributes\": {\n \"\
53-
identity_type\": \"Any\",\n \"personal_area_level\": \"Country\",\n\
54-
\ \"business_area_level\": \"Country\",\n \"address_area_level\"\
53+
identity_type\": \"Any\",\n \"personal_area_level\": \"country\",\n\
54+
\ \"business_area_level\": \"country\",\n \"address_area_level\"\
5555
: \"Country\",\n \"personal_proof_qty\": 2,\n \"business_proof_qty\"\
5656
: 1,\n \"address_proof_qty\": 1,\n \"personal_mandatory_fields\"\
5757
: [\n \"Country\"\n ],\n \"business_mandatory_fields\"\
@@ -86,9 +86,9 @@ interactions:
8686
,\n \"related\": \"https://sandbox-api.didww.com/v3/address_requirements/51b293af-a496-4bf2-9c68-5221b3b0dc1e/address_proof_types\"\
8787
\n }\n }\n }\n },\n {\n \"id\": \"f7c2a9a4-a40e-4f22-98ff-0f53c86052ac\"\
8888
,\n \"type\": \"address_requirements\",\n \"attributes\": {\n \"\
89-
identity_type\": \"Any\",\n \"personal_area_level\": \"WorldWide\"\
90-
,\n \"business_area_level\": \"Country\",\n \"address_area_level\"\
91-
: \"WorldWide\",\n \"personal_proof_qty\": 1,\n \"business_proof_qty\"\
89+
identity_type\": \"Any\",\n \"personal_area_level\": \"world_wide\"\
90+
,\n \"business_area_level\": \"country\",\n \"address_area_level\"\
91+
: \"world_wide\",\n \"personal_proof_qty\": 1,\n \"business_proof_qty\"\
9292
: 1,\n \"address_proof_qty\": 1,\n \"personal_mandatory_fields\"\
9393
: null,\n \"business_mandatory_fields\": [\n \"Country\"\n\
9494
\ ],\n \"service_description_required\": false,\n \"\
@@ -122,8 +122,8 @@ interactions:
122122
,\n \"related\": \"https://sandbox-api.didww.com/v3/address_requirements/f7c2a9a4-a40e-4f22-98ff-0f53c86052ac/address_proof_types\"\
123123
\n }\n }\n }\n },\n {\n \"id\": \"edb71cff-d5e8-44ff-ba36-6f758066c175\"\
124124
,\n \"type\": \"address_requirements\",\n \"attributes\": {\n \"\
125-
identity_type\": \"Any\",\n \"personal_area_level\": \"Country\",\n\
126-
\ \"business_area_level\": \"Country\",\n \"address_area_level\"\
125+
identity_type\": \"Any\",\n \"personal_area_level\": \"country\",\n\
126+
\ \"business_area_level\": \"country\",\n \"address_area_level\"\
127127
: \"Country\",\n \"personal_proof_qty\": 1,\n \"business_proof_qty\"\
128128
: 1,\n \"address_proof_qty\": 0,\n \"personal_mandatory_fields\"\
129129
: [\n \"Country\"\n ],\n \"business_mandatory_fields\"\
@@ -158,9 +158,9 @@ interactions:
158158
,\n \"related\": \"https://sandbox-api.didww.com/v3/address_requirements/edb71cff-d5e8-44ff-ba36-6f758066c175/address_proof_types\"\
159159
\n }\n }\n }\n },\n {\n \"id\": \"90b72a1a-1ebd-4771-b818-f7123f8ff7ec\"\
160160
,\n \"type\": \"address_requirements\",\n \"attributes\": {\n \"\
161-
identity_type\": \"Any\",\n \"personal_area_level\": \"WorldWide\"\
162-
,\n \"business_area_level\": \"WorldWide\",\n \"address_area_level\"\
163-
: \"WorldWide\",\n \"personal_proof_qty\": 0,\n \"business_proof_qty\"\
161+
identity_type\": \"Any\",\n \"personal_area_level\": \"world_wide\"\
162+
,\n \"business_area_level\": \"world_wide\",\n \"address_area_level\"\
163+
: \"world_wide\",\n \"personal_proof_qty\": 0,\n \"business_proof_qty\"\
164164
: 0,\n \"address_proof_qty\": 0,\n \"personal_mandatory_fields\"\
165165
: null,\n \"business_mandatory_fields\": null,\n \"service_description_required\"\
166166
: false,\n \"restriction_message\": \"restriction_message\"\n \

tests/fixtures/address_requirements/show.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ 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\"\
18-
: \"WorldWide\",\n \"address_area_level\": \"WorldWide\",\n \"personal_proof_qty\"\
17+
: \"any\",\n \"personal_area_level\": \"world_wide\",\n \"business_area_level\"\
18+
: \"world_wide\",\n \"address_area_level\": \"world_wide\",\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 \
2121
\ \"Country\",\n \"Personal Tax ID\"\n ],\n \"business_mandatory_fields\"\
@@ -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)