Skip to content

Commit 9bef17a

Browse files
committed
Workaround for boolean type
1 parent 5154b3c commit 9bef17a

File tree

65 files changed

+910
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+910
-2
lines changed

src/Resources/Params/AddAdminRoleParams.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,16 @@ class AddAdminRoleParams
2121

2222
/** @var stringlist The list of denied access entries separated by the ';' symbol (the API function names) */
2323
public $denied_entries;
24+
25+
public function toArray()
26+
{
27+
return [
28+
'admin_role_name' => $this->admin_role_name,
29+
'admin_role_active' => $this->admin_role_active !== null ? (filter_var($this->admin_role_active, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
30+
'like_admin_role_id' => $this->like_admin_role_id,
31+
'like_admin_role_name' => $this->like_admin_role_name,
32+
'allowed_entries' => $this->allowed_entries,
33+
'denied_entries' => $this->denied_entries,
34+
];
35+
}
2436
}

src/Resources/Params/AddAdminUserParams.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,16 @@ class AddAdminUserParams
2121

2222
/** @var stringlist The role(s) name(s) created via Managing Admin Roles methods. The attaching admin role name that can be used instead of admin_role_id */
2323
public $admin_role_name;
24+
25+
public function toArray()
26+
{
27+
return [
28+
'new_admin_user_name' => $this->new_admin_user_name,
29+
'admin_user_display_name' => $this->admin_user_display_name,
30+
'new_admin_user_password' => $this->new_admin_user_password,
31+
'admin_user_active' => $this->admin_user_active !== null ? (filter_var($this->admin_user_active, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
32+
'admin_role_id' => $this->admin_role_id,
33+
'admin_role_name' => $this->admin_role_name,
34+
];
35+
}
2436
}

src/Resources/Params/AddApplicationParams.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@ class AddApplicationParams
99

1010
/** @var boolean Enable secure storage for all logs and records of the application */
1111
public $secure_record_storage;
12+
13+
public function toArray()
14+
{
15+
return [
16+
'application_name' => $this->application_name,
17+
'secure_record_storage' => $this->secure_record_storage !== null ? (filter_var($this->secure_record_storage, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
18+
];
19+
}
1220
}

src/Resources/Params/AddAuthorizedAccountIPParams.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@ class AddAuthorizedAccountIPParams
99

1010
/** @var boolean Set false to add the IP to the blacklist */
1111
public $allowed;
12+
13+
public function toArray()
14+
{
15+
return [
16+
'authorized_ip' => $this->authorized_ip,
17+
'allowed' => $this->allowed !== null ? (filter_var($this->allowed, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
18+
];
19+
}
1220
}

src/Resources/Params/AddPushCredentialParams.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function toArray()
6060
'cert_content' => $this->cert_content ? new \CURLFile($this->cert_content, null, basename($this->cert_content)) : null,
6161
'cert_file_name' => $this->cert_file_name,
6262
'cert_password' => $this->cert_password,
63-
'is_dev_mode' => $this->is_dev_mode,
63+
'is_dev_mode' => $this->is_dev_mode !== null ? (filter_var($this->is_dev_mode, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
6464
'sender_id' => $this->sender_id,
6565
'server_key' => $this->server_key,
6666
'service_account_file' => $this->service_account_file ? new \CURLFile($this->service_account_file, null, basename($this->service_account_file)) : null,

src/Resources/Params/AddQueueParams.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,19 @@ class AddQueueParams
3030

3131
/** @var number The average service time in seconds. Specify the parameter to correct or initialize the waiting time prediction */
3232
public $average_service_time;
33+
34+
public function toArray()
35+
{
36+
return [
37+
'application_id' => $this->application_id,
38+
'application_name' => $this->application_name,
39+
'acd_queue_name' => $this->acd_queue_name,
40+
'acd_queue_priority' => $this->acd_queue_priority,
41+
'auto_binding' => $this->auto_binding !== null ? (filter_var($this->auto_binding, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
42+
'service_probability' => $this->service_probability,
43+
'max_queue_size' => $this->max_queue_size,
44+
'max_waiting_time' => $this->max_waiting_time,
45+
'average_service_time' => $this->average_service_time,
46+
];
47+
}
3348
}

src/Resources/Params/AddRuleParams.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@ class AddRuleParams
2727

2828
/** @var stringlist The scenario name list separated by the ';' symbol. Can be used instead of scenario_id */
2929
public $scenario_name;
30+
31+
public function toArray()
32+
{
33+
return [
34+
'application_id' => $this->application_id,
35+
'application_name' => $this->application_name,
36+
'rule_name' => $this->rule_name,
37+
'rule_pattern' => $this->rule_pattern,
38+
'rule_pattern_exclude' => $this->rule_pattern_exclude,
39+
'video_conference' => $this->video_conference !== null ? (filter_var($this->video_conference, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
40+
'scenario_id' => $this->scenario_id,
41+
'scenario_name' => $this->scenario_name,
42+
];
43+
}
3044
}

src/Resources/Params/AddScenarioParams.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@ class AddScenarioParams
1818

1919
/** @var boolean Rewrite the existing scenario */
2020
public $rewrite;
21+
22+
public function toArray()
23+
{
24+
return [
25+
'scenario_name' => $this->scenario_name,
26+
'scenario_script' => $this->scenario_script,
27+
'rule_id' => $this->rule_id,
28+
'rule_name' => $this->rule_name,
29+
'rewrite' => $this->rewrite !== null ? (filter_var($this->rewrite, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
30+
];
31+
}
2132
}

src/Resources/Params/AddUserParams.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,19 @@ class AddUserParams
3030

3131
/** @var string Any string */
3232
public $user_custom_data;
33+
34+
public function toArray()
35+
{
36+
return [
37+
'user_name' => $this->user_name,
38+
'user_display_name' => $this->user_display_name,
39+
'user_password' => $this->user_password,
40+
'application_id' => $this->application_id,
41+
'application_name' => $this->application_name,
42+
'parent_accounting' => $this->parent_accounting !== null ? (filter_var($this->parent_accounting, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
43+
'mobile_phone' => $this->mobile_phone,
44+
'user_active' => $this->user_active !== null ? (filter_var($this->user_active, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
45+
'user_custom_data' => $this->user_custom_data,
46+
];
47+
}
3348
}

src/Resources/Params/AttachPhoneNumberParams.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@ class AttachPhoneNumberParams
2727

2828
/** @var boolean The force verification flag */
2929
public $force_verification;
30+
31+
public function toArray()
32+
{
33+
return [
34+
'phone_count' => $this->phone_count,
35+
'phone_number' => $this->phone_number,
36+
'country_code' => $this->country_code,
37+
'phone_category_name' => $this->phone_category_name,
38+
'country_state' => $this->country_state,
39+
'phone_region_id' => $this->phone_region_id,
40+
'regulation_address_id' => $this->regulation_address_id,
41+
'force_verification' => $this->force_verification !== null ? (filter_var($this->force_verification, FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false') : null,
42+
];
43+
}
3044
}

0 commit comments

Comments
 (0)