Mandrill_Exports::activity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 7
dl 0
loc 4
rs 10
1
<?php
2
3
class Mandrill_Exports
4
{
5
6
    private $master;
7
8
    public function __construct(Mandrill $master)
9
    {
10
        $this->master = $master;
11
    }
12
13
    /**
14
     * Returns information about an export job. If the export job's state is 'complete',
15
      the returned data will include a URL you can use to fetch the results. Every export
16
      job produces a zip archive, but the format of the archive is distinct for each job
17
      type. The api calls that initiate exports include more details about the output format
18
      for that job type.
19
     * @param string $id an export job identifier
20
     * @return struct the information about the export
0 ignored issues
show
Bug introduced by
The type struct was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
     *     - id string the unique identifier for this Export. Use this identifier when checking the export job's status
22
     *     - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
23
     *     - type string the type of the export job - activity, reject, or whitelist
24
     *     - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
25
     *     - state string the export job's state - waiting, working, complete, error, or expired.
26
     *     - result_url string the url for the export job's results, if the job is completed.
27
     */
28
    public function info($id)
29
    {
30
        $_params = array("id" => $id);
31
        return $this->master->call('exports/info', $_params);
32
    }
33
34
    /**
35
     * Returns a list of your exports.
36
     * @return array the account's exports
37
     *     - return[] struct the individual export info
38
     *         - id string the unique identifier for this Export. Use this identifier when checking the export job's status
39
     *         - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
40
     *         - type string the type of the export job - activity, reject, or whitelist
41
     *         - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
42
     *         - state string the export job's state - waiting, working, complete, error, or expired.
43
     *         - result_url string the url for the export job's results, if the job is completed.
44
     */
45
    public function getList()
46
    {
47
        $_params = array();
48
        return $this->master->call('exports/list', $_params);
49
    }
50
51
    /**
52
     * Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive
53
      containing a single file named rejects.csv that includes the following fields: email,
54
      reason, detail, created_at, expires_at, last_event_at, expires_at.
55
     * @param string $notify_email an optional email address to notify when the export job has finished.
56
     * @return struct information about the rejects export job that was started
57
     *     - id string the unique identifier for this Export. Use this identifier when checking the export job's status
58
     *     - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
59
     *     - type string the type of the export job
60
     *     - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
61
     *     - state string the export job's state
62
     *     - result_url string the url for the export job's results, if the job is complete
63
     */
64
    public function rejects($notify_email = null)
65
    {
66
        $_params = array("notify_email" => $notify_email);
67
        return $this->master->call('exports/rejects', $_params);
68
    }
69
70
    /**
71
     * Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive
72
      containing a single file named whitelist.csv that includes the following fields:
73
      email, detail, created_at.
74
     * @param string $notify_email an optional email address to notify when the export job has finished.
75
     * @return struct information about the whitelist export job that was started
76
     *     - id string the unique identifier for this Export. Use this identifier when checking the export job's status
77
     *     - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
78
     *     - type string the type of the export job
79
     *     - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
80
     *     - state string the export job's state
81
     *     - result_url string the url for the export job's results, if the job is complete
82
     */
83
    public function whitelist($notify_email = null)
84
    {
85
        $_params = array("notify_email" => $notify_email);
86
        return $this->master->call('exports/whitelist', $_params);
87
    }
88
89
    /**
90
     * Begins an export of your activity history. The activity will be exported to a zip archive
91
      containing a single file named activity.csv in the same format as you would be able to export
92
      from your account's activity view. It includes the following fields: Date, Email Address,
93
      Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom
94
      metadata fields, they will be included in the exported data.
95
     * @param string $notify_email an optional email address to notify when the export job has finished
96
     * @param string $date_from start date as a UTC string in YYYY-MM-DD HH:MM:SS format
97
     * @param string $date_to end date as a UTC string in YYYY-MM-DD HH:MM:SS format
98
     * @param array $tags an array of tag names to narrow the export to; will match messages that contain ANY of the tags
99
     *     - tags[] string a tag name
100
     * @param array $senders an array of senders to narrow the export to
101
     *     - senders[] string a sender address
102
     * @param array $states an array of states to narrow the export to; messages with ANY of the states will be included
103
     *     - states[] string a message state
104
     * @param array $api_keys an array of api keys to narrow the export to; messsagse sent with ANY of the keys will be included
105
     *     - api_keys[] string an API key associated with your account
106
     * @return struct information about the activity export job that was started
107
     *     - id string the unique identifier for this Export. Use this identifier when checking the export job's status
108
     *     - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
109
     *     - type string the type of the export job
110
     *     - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
111
     *     - state string the export job's state
112
     *     - result_url string the url for the export job's results, if the job is complete
113
     */
114
    public function activity($notify_email = null, $date_from = null, $date_to = null, $tags = null, $senders = null, $states = null, $api_keys = null)
115
    {
116
        $_params = array("notify_email" => $notify_email, "date_from" => $date_from, "date_to" => $date_to, "tags" => $tags, "senders" => $senders, "states" => $states, "api_keys" => $api_keys);
117
        return $this->master->call('exports/activity', $_params);
118
    }
119
}
120