Skip to content

Commit

Permalink
Remove the local_prefix attribute from DID groups endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanov-Anton authored and gigorok committed Jun 23, 2022
1 parent 951bc3a commit b282510
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 14 deletions.
2 changes: 0 additions & 2 deletions examples/did_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
$didGroup->getId(), // df73511e-3b8e-4967-9bd8-d7b88ae1a084
$didGroup->getAreaName(), // Beverly Hills
$didGroup->getPrefix(), // 352, 310
$didGroup->getLocalPrefix(), // ""
$didGroup->getFeatures(), // ['voice']
$didGroup->getIsMetered(), // false
$didGroup->getAllowAdditionalChannels(), // true
Expand All @@ -43,7 +42,6 @@
$didGroup->getId(), // df73511e-3b8e-4967-9bd8-d7b88ae1a084
$didGroup->getAreaName(), // Beverly Hills
$didGroup->getPrefix(), // 352, 310
$didGroup->getLocalPrefix(), // ""
$didGroup->getFeatures(), // ['voice']
$didGroup->getIsMetered(), // false
$didGroup->getAllowAdditionalChannels(), // true
Expand Down
5 changes: 0 additions & 5 deletions src/Item/DidGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public function getPrefix(): string
return $this->getAttributes()['prefix'];
}

public function getLocalPrefix(): string
{
return $this->getAttributes()['local_prefix'];
}

public function getFeatures(): array
{
return $this->getAttributes()['features'];
Expand Down
1 change: 0 additions & 1 deletion tests/AvailableDidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function testFind()
$this->assertInstanceOf('Didww\Item\DidGroup', $didGroupRelation->getIncluded());
$this->assertEquals($didGroupRelation->getIncluded()->getAttributes(), [
'prefix' => '616',
'local_prefix' => '',
'features' => ['voice'],
'is_metered' => false,
'area_name' => 'Grand Rapids',
Expand Down
1 change: 0 additions & 1 deletion tests/DidGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function testFind()
$this->assertInstanceOf('Didww\Item\DidGroup', $didGroupDocument->getData());
$this->assertEquals($didGroupDocument->getData()->getAttributes(), [
'prefix' => '241',
'local_prefix' => '',
'features' => ['voice'],
'is_metered' => false,
'area_name' => 'Aachen',
Expand Down
1 change: 0 additions & 1 deletion tests/DidReservationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function testFind()
$this->assertInstanceOf('Didww\Item\DidGroup', $didGroupRelation->getIncluded());
$this->assertEquals($didGroupRelation->getIncluded()->getAttributes(), [
'prefix' => '949',
'local_prefix' => '',
'features' => ['voice'],
'is_metered' => false,
'area_name' => 'Saddleback Valley',
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/available_dids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Access-Control-Allow-Headers: 'Origin, X-Requested-With, Content-Type, Accept, x-api-key, api-key, x-api-token, Cache-Control'
Access-Control-Allow-Methods: 'GET, POST, DELETE, PUT, PATCH, OPTIONS'
Access-Control-Allow-Credentials: 'true'
body: '{"data":{"id":"0b76223b-9625-412f-b0f3-330551473e7e","type":"available_dids","attributes":{"number":"16169886810"},"relationships":{"did_group":{"links":{"self":"https://sandbox-api.didww.com/v3/available_dids/0b76223b-9625-412f-b0f3-330551473e7e/relationships/did_group","related":"https://sandbox-api.didww.com/v3/available_dids/0b76223b-9625-412f-b0f3-330551473e7e/did_group"},"data":{"type":"did_groups","id":"a9e3d346-d7bc-4a85-adb0-8ef1119cf237"}}}},"included":[{"id":"a9e3d346-d7bc-4a85-adb0-8ef1119cf237","type":"did_groups","attributes":{"prefix":"616","local_prefix":"","features":["voice"],"is_metered":false,"area_name":"Grand Rapids","allow_additional_channels":true},"relationships":{"country":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/country","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/country"}},"city":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/city","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/city"}},"did_group_type":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/did_group_type","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/did_group_type"}},"region":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/region","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/region"}},"stock_keeping_units":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/stock_keeping_units","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/stock_keeping_units"},"data":[{"type":"stock_keeping_units","id":"bdff43ad-2db8-428c-a65c-f2d4d43720b6"},{"type":"stock_keeping_units","id":"884835e7-fffb-4293-9847-89f65449d70c"}]}},"meta":{"needs_registration":false,"is_available":true,"available_dids_enabled":true}},{"id":"bdff43ad-2db8-428c-a65c-f2d4d43720b6","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.09","channels_included_count":0}},{"id":"884835e7-fffb-4293-9847-89f65449d70c","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.19","channels_included_count":2}}]}'
body: '{"data":{"id":"0b76223b-9625-412f-b0f3-330551473e7e","type":"available_dids","attributes":{"number":"16169886810"},"relationships":{"did_group":{"links":{"self":"https://sandbox-api.didww.com/v3/available_dids/0b76223b-9625-412f-b0f3-330551473e7e/relationships/did_group","related":"https://sandbox-api.didww.com/v3/available_dids/0b76223b-9625-412f-b0f3-330551473e7e/did_group"},"data":{"type":"did_groups","id":"a9e3d346-d7bc-4a85-adb0-8ef1119cf237"}}}},"included":[{"id":"a9e3d346-d7bc-4a85-adb0-8ef1119cf237","type":"did_groups","attributes":{"prefix":"616","features":["voice"],"is_metered":false,"area_name":"Grand Rapids","allow_additional_channels":true},"relationships":{"country":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/country","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/country"}},"city":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/city","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/city"}},"did_group_type":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/did_group_type","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/did_group_type"}},"region":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/region","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/region"}},"stock_keeping_units":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/relationships/stock_keeping_units","related":"https://sandbox-api.didww.com/v3/did_groups/a9e3d346-d7bc-4a85-adb0-8ef1119cf237/stock_keeping_units"},"data":[{"type":"stock_keeping_units","id":"bdff43ad-2db8-428c-a65c-f2d4d43720b6"},{"type":"stock_keeping_units","id":"884835e7-fffb-4293-9847-89f65449d70c"}]}},"meta":{"needs_registration":false,"is_available":true,"available_dids_enabled":true}},{"id":"bdff43ad-2db8-428c-a65c-f2d4d43720b6","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.09","channels_included_count":0}},{"id":"884835e7-fffb-4293-9847-89f65449d70c","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.19","channels_included_count":2}}]}'

-
request:
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/did_groups.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/fixtures/did_reservations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Access-Control-Allow-Headers: 'Origin, X-Requested-With, Content-Type, Accept, x-api-key, api-key, x-api-token, Cache-Control'
Access-Control-Allow-Methods: 'GET, POST, DELETE, PUT, PATCH, OPTIONS'
Access-Control-Allow-Credentials: 'true'
body: '{"data":{"id":"fd38d3ff-80cf-4e67-a605-609a2884a5c4","type":"did_reservations","attributes":{"expire_at":"2018-12-28T16:22:00.417Z","created_at":"2018-12-28T16:12:00.440Z","description":"DIDWW"},"relationships":{"available_did":{"links":{"self":"https://sandbox-api.didww.com/v3/did_reservations/fd38d3ff-80cf-4e67-a605-609a2884a5c4/relationships/available_did","related":"https://sandbox-api.didww.com/v3/did_reservations/fd38d3ff-80cf-4e67-a605-609a2884a5c4/available_did"},"data":{"type":"available_dids","id":"857d1462-5f43-4238-b007-ff05f282e41b"}}}},"included":[{"id":"857d1462-5f43-4238-b007-ff05f282e41b","type":"available_dids","attributes":{"number":"19492033398"},"relationships":{"did_group":{"links":{"self":"https://sandbox-api.didww.com/v3/available_dids/857d1462-5f43-4238-b007-ff05f282e41b/relationships/did_group","related":"https://sandbox-api.didww.com/v3/available_dids/857d1462-5f43-4238-b007-ff05f282e41b/did_group"},"data":{"type":"did_groups","id":"23bc0f41-67c0-40c3-b877-dccbbb65d5e4"}}}},{"id":"23bc0f41-67c0-40c3-b877-dccbbb65d5e4","type":"did_groups","attributes":{"prefix":"949","local_prefix":"","features":["voice"],"is_metered":false,"area_name":"Saddleback Valley","allow_additional_channels":true},"relationships":{"country":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/country","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/country"}},"city":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/city","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/city"}},"did_group_type":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/did_group_type","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/did_group_type"}},"region":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/region","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/region"}},"stock_keeping_units":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/stock_keeping_units","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/stock_keeping_units"},"data":[{"type":"stock_keeping_units","id":"209a43fa-41a5-490f-9376-97fdb0a727b3"},{"type":"stock_keeping_units","id":"76492222-4895-42bc-89be-a681a1e40f37"}]}},"meta":{"needs_registration":false,"is_available":true,"available_dids_enabled":true}},{"id":"209a43fa-41a5-490f-9376-97fdb0a727b3","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.09","channels_included_count":0}},{"id":"76492222-4895-42bc-89be-a681a1e40f37","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.19","channels_included_count":2}}],"meta":{"available_count":9}}'
body: '{"data":{"id":"fd38d3ff-80cf-4e67-a605-609a2884a5c4","type":"did_reservations","attributes":{"expire_at":"2018-12-28T16:22:00.417Z","created_at":"2018-12-28T16:12:00.440Z","description":"DIDWW"},"relationships":{"available_did":{"links":{"self":"https://sandbox-api.didww.com/v3/did_reservations/fd38d3ff-80cf-4e67-a605-609a2884a5c4/relationships/available_did","related":"https://sandbox-api.didww.com/v3/did_reservations/fd38d3ff-80cf-4e67-a605-609a2884a5c4/available_did"},"data":{"type":"available_dids","id":"857d1462-5f43-4238-b007-ff05f282e41b"}}}},"included":[{"id":"857d1462-5f43-4238-b007-ff05f282e41b","type":"available_dids","attributes":{"number":"19492033398"},"relationships":{"did_group":{"links":{"self":"https://sandbox-api.didww.com/v3/available_dids/857d1462-5f43-4238-b007-ff05f282e41b/relationships/did_group","related":"https://sandbox-api.didww.com/v3/available_dids/857d1462-5f43-4238-b007-ff05f282e41b/did_group"},"data":{"type":"did_groups","id":"23bc0f41-67c0-40c3-b877-dccbbb65d5e4"}}}},{"id":"23bc0f41-67c0-40c3-b877-dccbbb65d5e4","type":"did_groups","attributes":{"prefix":"949","features":["voice"],"is_metered":false,"area_name":"Saddleback Valley","allow_additional_channels":true},"relationships":{"country":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/country","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/country"}},"city":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/city","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/city"}},"did_group_type":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/did_group_type","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/did_group_type"}},"region":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/region","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/region"}},"stock_keeping_units":{"links":{"self":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/relationships/stock_keeping_units","related":"https://sandbox-api.didww.com/v3/did_groups/23bc0f41-67c0-40c3-b877-dccbbb65d5e4/stock_keeping_units"},"data":[{"type":"stock_keeping_units","id":"209a43fa-41a5-490f-9376-97fdb0a727b3"},{"type":"stock_keeping_units","id":"76492222-4895-42bc-89be-a681a1e40f37"}]}},"meta":{"needs_registration":false,"is_available":true,"available_dids_enabled":true}},{"id":"209a43fa-41a5-490f-9376-97fdb0a727b3","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.09","channels_included_count":0}},{"id":"76492222-4895-42bc-89be-a681a1e40f37","type":"stock_keeping_units","attributes":{"setup_price":"0.0","monthly_price":"0.19","channels_included_count":2}}],"meta":{"available_count":9}}'

-
request:
Expand Down

0 comments on commit b282510

Please sign in to comment.