Skip to content

Commit

Permalink
Allow empty arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfui committed Nov 11, 2024
1 parent f38dd51 commit f311c71
Show file tree
Hide file tree
Showing 79 changed files with 85 additions and 160 deletions.
14 changes: 7 additions & 7 deletions src/ConstantContact/Definition/ActivityDeleteListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
/**
* @property \PHPFUI\ConstantContact\UUID $activity_id Unique ID for the delete list batch job.
* @property string $state The state of the request:
<p><ul>
<li>initialized - request has been received</li>
<li>processing - request is being processed</li>
<li>completed - job completed</li>
<li>cancelled - request was cancelled</li>
<li>failed - job failed to complete</li>
<li>timed_out - the request timed out before completing"</li>
* <p><ul>
* <li>initialized - request has been received</li>
* <li>processing - request is being processed</li>
* <li>completed - job completed</li>
* <li>cancelled - request was cancelled</li>
* <li>failed - job failed to complete</li>
* <li>timed_out - the request timed out before completing"</li>
* </ul> </p>
* @property \PHPFUI\ConstantContact\DateTime $created_at Date and time that the request was received, in ISO-8601 formmat.
* @property \PHPFUI\ConstantContact\DateTime $updated_at Date and time that the request status was updated, in ISO-8601 format.
Expand Down
14 changes: 7 additions & 7 deletions src/ConstantContact/Definition/ActivityExportStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
/**
* @property \PHPFUI\ConstantContact\UUID $activity_id Unique ID for the activity.
* @property string $state <p> The state of the request: <ul>
<li>initialized - request has been received</li>
<li>processing - request is being processed</li>
<li>completed - job completed</li>
<li>cancelled - request was cancelled</li>
<li>failed - job failed to complete</li>
<li>timed_out - the request timed out before completing"</li>
</ul> </p>
* <li>initialized - request has been received</li>
* <li>processing - request is being processed</li>
* <li>completed - job completed</li>
* <li>cancelled - request was cancelled</li>
* <li>failed - job failed to complete</li>
* <li>timed_out - the request timed out before completing"</li>
* </ul> </p>
* @property \PHPFUI\ConstantContact\DateTime $started_at Timestamp showing when we began processing the activity request, in ISO-8601 format.
* @property \PHPFUI\ConstantContact\DateTime $completed_at Timestamp showing when we completed processing the activity, in ISO-8601 format.
* @property \PHPFUI\ConstantContact\DateTime $created_at Timestamp showing when we created the activity, in ISO-8601 format.
Expand Down
4 changes: 2 additions & 2 deletions src/ConstantContact/Definition/ActivityImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/**
* @property \PHPFUI\ConstantContact\UUID $activity_id Unique ID for the activity.
* @property string $state The state of the request:
<p><ul>
* <li>initialized - request has been received</li>
* <p><ul>
* <li>initialized - request has been received</li>
* <li>processing - request is being processed</li>
* <li>completed - job completed</li>
* <li>cancelled - request was cancelled</li>
Expand Down
4 changes: 0 additions & 4 deletions src/ConstantContact/Definition/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@ public function getData() : array
}
elseif (\is_array($value))
{
if (! \count($value))
{
continue;
}
$result[$field] = [];

foreach ($value as $name => $item)
Expand Down
28 changes: 14 additions & 14 deletions src/ConstantContact/Definition/EmailSendHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
* @property array $segment_ids The contact segments that Constant Contact sent the email campaign activity to as an array of <code>segment_id</code> integers.
* @property int $count The number of contacts that Constant Contact sent this email campaign activity to. This property is specific to each send history object. When you resend an email campaign activity, Constant Contact only sends it to new contacts in the contact lists or segments you are using.
* @property \PHPFUI\ConstantContact\DateTime $run_date The system generated date and time that Constant Contact sent the email campaign activity to contacts in ISO-8601 format.
* @property string $send_status The send status for the email campaign activity. Valid values are: <ul>
* @property string $send_status The send status for the email campaign activity. Valid values are: <ul>
* <li><code>COMPLETED</code>: Constant Contact successfully sent the email campaign activity.</li>
* <li><code>ERRORED</code>: Constant Contact encountered an error when sending the email campaign activity.<li> * </ul>
* @property int $reason_code The reason why the send attempt completed or encountered an error. This method returns <code>0</code> if Constant Contact successfully sent the email campaign activity to contacts. Possible <code>reason_code</code> values are: <ul>
* <li>0 — Constant Contact successfully sent the email to contacts.</li>
* <li>1 — An error occurred when sending this email. Try scheduling it again, or contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a>.</li>
* <li>2 — We were unable to send the email. Please contact our <a href='http://knowledgebase.constantcontact.com/articles/KnowledgeBase/5782-contact-an-account-review-and-deliverability-specialist' target='_blank'>Account Review Team</a> for more information.</li>
* <li>3 — This Constant Contact account cannot currently send emails. This can be due to billing or product expiration.</li>
* <li>4 — You're not able to send the email to that many contacts. Remove contacts from the contact lists you are using or select a list with fewer contacts.</li>
* <li>5 — The email is currently in staging. For more information, see the <a href='http://knowledgebase.constantcontact.com/articles/KnowledgeBase/7402-email-staging' target='_blank>Email Staging Knowledge Base article</a>.</li>
* <li>6 — Constant Contact was unable to finish sending this email to all of the contacts on your list. Please contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a> for more information.</li>
* <li>7 — The email contains invalid images. This can be caused when one or more images in the email are longer available in your image library.</li>
* <li>8 — The email contains a link URL that exceeds 1005 characters.</li>
* <li>9 — Constant Contact was unable to verify your authenticated Sender address. Please contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a> for more information.</li>
* <li>10 — Constant Contact was unable to verify your authenticated Sender address. Please contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a> for more information.</li>
* <li>11 — This Constant Contact account cannot send survey invitations.</li>
* <li>12 — Constant Contact attempted to send the email, but there were no eligible contacts to send it to. This can be caused by an invalid contact list, a contact list with no contacts, or a contact list with no new contacts during a resend. This method displays <code>reason_code</code> 12 as a send attempt with a <code>send_status</code> of COMPLETED and a <code>count</code> of 0.</li> * </ul>
* <li>0 — Constant Contact successfully sent the email to contacts.</li>
* <li>1 — An error occurred when sending this email. Try scheduling it again, or contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a>.</li>
* <li>2 — We were unable to send the email. Please contact our <a href='http://knowledgebase.constantcontact.com/articles/KnowledgeBase/5782-contact-an-account-review-and-deliverability-specialist' target='_blank'>Account Review Team</a> for more information.</li>
* <li>3 — This Constant Contact account cannot currently send emails. This can be due to billing or product expiration.</li>
* <li>4 — You're not able to send the email to that many contacts. Remove contacts from the contact lists you are using or select a list with fewer contacts.</li>
* <li>5 — The email is currently in staging. For more information, see the <a href='http://knowledgebase.constantcontact.com/articles/KnowledgeBase/7402-email-staging' target='_blank>Email Staging Knowledge Base article</a>.</li>
* <li>6 — Constant Contact was unable to finish sending this email to all of the contacts on your list. Please contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a> for more information.</li>
* <li>7 — The email contains invalid images. This can be caused when one or more images in the email are longer available in your image library.</li>
* <li>8 — The email contains a link URL that exceeds 1005 characters.</li>
* <li>9 — Constant Contact was unable to verify your authenticated Sender address. Please contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a> for more information.</li>
* <li>10 — Constant Contact was unable to verify your authenticated Sender address. Please contact <a href='http://support.constantcontact.com' target='_blank'>Customer Support</a> for more information.</li>
* <li>11 — This Constant Contact account cannot send survey invitations.</li>
* <li>12 — Constant Contact attempted to send the email, but there were no eligible contacts to send it to. This can be caused by an invalid contact list, a contact list with no contacts, or a contact list with no new contacts during a resend. This method displays <code>reason_code</code> 12 as a send attempt with a <code>send_status</code> of COMPLETED and a <code>count</code> of 0.</li> * </ul>
*/
class EmailSendHistory extends \PHPFUI\ConstantContact\Definition\Base
{
Expand Down
6 changes: 3 additions & 3 deletions src/ConstantContact/Definition/PlanInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* @property string $plan_type Use this property to update the client account billing plan to a different billing plan. After changing the <code>plan_type</code> from <code>TRIAL</code> to any other billing plan type, you cannot change it back to <code>TRIAL</code>.
* <ul>
* <li><code>TRIAL</code>: A non-billable account with an expiration date that allows clients to try Constant Contact product features.</li>
* <li><code>GOLD</code>: A billable client account plan.</li>
* <li><code>SILVER</code>: A billable client account plan.</li>
* <li><code>BRONZE</code>: A billable client account plan.</li>
* <li><code>GOLD</code>: A billable client account plan.</li>
* <li><code>SILVER</code>: A billable client account plan.</li>
* <li><code>BRONZE</code>: A billable client account plan.</li>
* </ul>
* @property int $plan_group_id Updates an existing client account billing plan group to a new billing plan group. If you don't know the `plan_group_id` to use, contact our API support team.
* @property int $billing_day_of_month This property is required if a client account is not set up to use single billing. You can choose to enter a specific day of the month or accept the default value, which is the day on which the <code>plan_type</code> value changes from a <code>TRIAL</code> plan to a different <code>plan_type</code>. For trial accounts, the value defaults to null. You can only change the <code>billing_day_of_month</code> when changing the <code>plan_type</code> value from <code>TRIAL</code> to a different <code>plan_type</code>, otherwise the value you enter is ignored.
Expand Down
2 changes: 1 addition & 1 deletion src/ConstantContact/Definition/PlanTiersObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @property string $plan_type The billing plan that is associated with a client's Constant Contact account. The billing plan determines which Constant Contact product features that the client account can access. If you are not on the latest billing plan, contact the Constant Contact Partner Team. However, older billing plans and <code>plan_type</code> enum values will continue to be supported. <ul>
* <li><code>TRIAL</code>: Provides limited product features for a non-billed account and the account has an expiration date.</li>
* <li><code>BRONZE</code>: Billable plan that provides basic email and marketing tools.</li>
* <li><code>BRONZE</code>: Billable plan that provides basic email and marketing tools.</li>
* <li><code>SILVER</code>: Billable plan that provides all features available in the <code>BRONZE</code> plan, and adds some additional email campaign to features, such as contact segmentation and social media ads integration.</li>
* <li><code>GOLD</code>: Billable plan that provides all available product features.</li> * </ul>
* @property array<\PHPFUI\ConstantContact\Definition\TierObject> $current_tiers Lists the billing plan tiers that are currently associated with a client account.
Expand Down
12 changes: 6 additions & 6 deletions src/ConstantContact/Definition/TrackingActivitySmsChannelDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* @property string $country_code The ISO country code that is associated with SMS address.
* @property string $state The SMS channel status:
* <ul><li><code>N</code>: not_set<li>
* <li><code>T</code>: temp_hold<li>
* <li><code>P</code>: pending_confirmation<li>
* <li><code>I</code>: implicit<li>
* <li><code>E</code>: explicit<li>
* <li><code>O</code>: unsubscribed<li>
* <li><code>D</code>:deprecated<li></ul>
* <li><code>T</code>: temp_hold<li>
* <li><code>P</code>: pending_confirmation<li>
* <li><code>I</code>: implicit<li>
* <li><code>E</code>: explicit<li>
* <li><code>O</code>: unsubscribed<li>
* <li><code>D</code>:deprecated<li></ul>
* @property string $formatted_international The formatted SMS number returned if the SMS <code>country_code</code> does not match the contacts <code>country_code</code>.
* @property string $formatted_national The formatted SMS number returned if the SMS <code>country_code</code> matches the contacts <code>country_code</code>.
*/
Expand Down
9 changes: 5 additions & 4 deletions src/ConstantContact/V3/Account/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
*
*
* @param string $confirm_status Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`.
*
* @param string $role_code Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`.
* @param string $email_address Use the `email_address` query parameter to search for a specific account email address.
*/
Expand Down Expand Up @@ -57,18 +57,21 @@ public function get(?string $confirm_status = null, ?string $role_code = null, ?

return $this->doGet(['confirm_status' => $confirm_status, 'role_code' => $role_code, 'email_address' => $email_address, ]);
}

/**
* @return ?array<\PHPFUI\ConstantContact\Definition\AccountEmails>
*/
public function getTyped(?string $confirm_status = null, ?string $role_code = null, ?string $email_address = null) : ?array
{
$data = $this->get($confirm_status, $role_code, $email_address);
if (is_null($data))

if (null === $data)
{
return null;
}

$array = [];

foreach ($data as $object)
{
$array[] = new \PHPFUI\ConstantContact\Definition\AccountEmails($object);
Expand All @@ -77,7 +80,6 @@ public function getTyped(?string $confirm_status = null, ?string $role_code = nu
return $array;
}


/**
* POST Add an Account Email Address
*
Expand Down Expand Up @@ -108,5 +110,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\AccountEmailInput $

return $data ? new \PHPFUI\ConstantContact\Definition\AccountEmailCreateResponse($data) : null;
}

}
2 changes: 0 additions & 2 deletions src/ConstantContact/V3/Account/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function getTyped(?string $extra_fields = null) : ?\PHPFUI\ConstantContac
return $data ? new \PHPFUI\ConstantContact\Definition\Customer($data) : null;
}


/**
* PUT (update) Account Details
*
Expand All @@ -74,5 +73,4 @@ public function putTyped(\PHPFUI\ConstantContact\Definition\CustomerPut $body) :

return $data ? new \PHPFUI\ConstantContact\Definition\CustomerPut($data) : null;
}

}
3 changes: 0 additions & 3 deletions src/ConstantContact/V3/Account/Summary/PhysicalAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function getTyped() : ?\PHPFUI\ConstantContact\Definition\AccountPhysical
return $data ? new \PHPFUI\ConstantContact\Definition\AccountPhysicalAddress($data) : null;
}


/**
* POST the Physical Address for the Account
*
Expand All @@ -60,7 +59,6 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\AccountPhysicalAddr
return $data ? new \PHPFUI\ConstantContact\Definition\AccountPhysicalAddress($data) : null;
}


/**
* PUT (update) the Physical Address for an Account
*
Expand Down Expand Up @@ -90,5 +88,4 @@ public function putTyped(\PHPFUI\ConstantContact\Definition\AccountPhysicalAddre

return $data ? new \PHPFUI\ConstantContact\Definition\AccountPhysicalAddress($data) : null;
}

}
6 changes: 4 additions & 2 deletions src/ConstantContact/V3/Account/User/Privileges.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,26 @@ public function get() : ?array

return $this->doGet([]);
}

/**
* @return ?array<\PHPFUI\ConstantContact\Definition\UserPrivilegesResource>
*/
public function getTyped() : ?array
{
$data = $this->get();
if (is_null($data))

if (null === $data)
{
return null;
}

$array = [];

foreach ($data as $object)
{
$array[] = new \PHPFUI\ConstantContact\Definition\UserPrivilegesResource($object);
}

return $array;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ public function getTyped(?int $limit = null, ?string $state = null) : ?\PHPFUI\C

return $data ? new \PHPFUI\ConstantContact\Definition\Activities($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/AddListMemberships.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\ListActivityAddCont

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityListsMembership($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/ContactDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\ContactDelete $body

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityDeleteStatus($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/ContactExports.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\ContactsExport $bod

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityExportStatus($data) : null;
}

}
5 changes: 2 additions & 3 deletions src/ConstantContact/V3/Activities/ContactsFileImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
* and the remaining data is dropped.
*
* @param string $file The CSV file you are importing. The column headings that you can use in the file are: `first_name`, `last_name`, `email`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, and `country`. The only required column heading is `email`.
You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named "first_name". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields.
*
* You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named "first_name". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields.
* @param array $list_ids Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact `list_id` values.
*/
public function post(string $file, array $list_ids) : ?array
Expand All @@ -46,5 +46,4 @@ public function postTyped(string $file, array $list_ids) : ?\PHPFUI\ConstantCont

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityImport($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/ContactsJsonImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\ContactsJsonImport

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityImport($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/ContactsTaggingsAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\TagAddRemoveContact

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityTagging($data) : null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\TagAddRemoveContact

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityTagging($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/ContactsTagsDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\TagIdList500Limit $

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityTagging($data) : null;
}

}
1 change: 0 additions & 1 deletion src/ConstantContact/V3/Activities/CustomFieldsDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ public function postTyped(\PHPFUI\ConstantContact\Definition\CustomFieldId100 $b

return $data ? new \PHPFUI\ConstantContact\Definition\ActivityDeleteCustomFields($data) : null;
}

}
Loading

0 comments on commit f311c71

Please sign in to comment.