1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. |
4
|
|
|
* |
5
|
|
|
* You are hereby granted a non-exclusive, worldwide, royalty-free license to |
6
|
|
|
* use, copy, modify, and distribute this software in source code or binary |
7
|
|
|
* form for use in connection with the web services and APIs provided by |
8
|
|
|
* Facebook. |
9
|
|
|
* |
10
|
|
|
* As with any software that integrates with the Facebook platform, your use |
11
|
|
|
* of this software is subject to the Facebook Developer Principles and |
12
|
|
|
* Policies [http://developers.facebook.com/policy/]. This copyright notice |
13
|
|
|
* shall be included in all copies or substantial portions of the software. |
14
|
|
|
* |
15
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
20
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21
|
|
|
* DEALINGS IN THE SOFTWARE. |
22
|
|
|
* |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
namespace FacebookAds\Object; |
26
|
|
|
|
27
|
|
|
use FacebookAds\ApiRequest; |
28
|
|
|
use FacebookAds\Cursor; |
29
|
|
|
use FacebookAds\Http\RequestInterface; |
30
|
|
|
use FacebookAds\TypeChecker; |
31
|
|
|
use FacebookAds\Object\Fields\ProductSetFields; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* This class is auto-generated. |
35
|
|
|
* |
36
|
|
|
* For any issues or feature requests related to this class, please let us know |
37
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
38
|
|
|
* pull request for this class. |
39
|
|
|
* |
40
|
|
|
*/ |
41
|
|
|
|
42
|
|
|
class ProductSet extends AbstractCrudObject { |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @deprecated getEndpoint function is deprecated |
46
|
|
|
*/ |
47
|
|
|
protected function getEndpoint() { |
48
|
|
|
return 'product_sets'; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return ProductSetFields |
53
|
|
|
*/ |
54
|
|
|
public static function getFieldsEnum() { |
55
|
|
|
return ProductSetFields::getInstance(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
protected static function getReferencedEnums() { |
59
|
|
|
$ref_enums = array(); |
60
|
|
|
return $ref_enums; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
|
64
|
|
|
public function getProducts(array $fields = array(), array $params = array(), $pending = false) { |
65
|
|
|
$this->assureId(); |
66
|
|
|
|
67
|
|
|
$param_types = array( |
68
|
|
|
'bulk_pagination' => 'bool', |
69
|
|
|
'filter' => 'Object', |
70
|
|
|
); |
71
|
|
|
$enums = array( |
72
|
|
|
); |
73
|
|
|
|
74
|
|
|
$request = new ApiRequest( |
75
|
|
|
$this->api, |
76
|
|
|
$this->data['id'], |
77
|
|
|
RequestInterface::METHOD_GET, |
78
|
|
|
'/products', |
79
|
|
|
new ProductItem(), |
80
|
|
|
'EDGE', |
81
|
|
|
ProductItem::getFieldsEnum()->getValues(), |
82
|
|
|
new TypeChecker($param_types, $enums) |
83
|
|
|
); |
84
|
|
|
$request->addParams($params); |
85
|
|
|
$request->addFields($fields); |
86
|
|
|
return $pending ? $request : $request->execute(); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) { |
90
|
|
|
$this->assureId(); |
91
|
|
|
|
92
|
|
|
$param_types = array( |
93
|
|
|
); |
94
|
|
|
$enums = array( |
95
|
|
|
); |
96
|
|
|
|
97
|
|
|
$request = new ApiRequest( |
98
|
|
|
$this->api, |
99
|
|
|
$this->data['id'], |
100
|
|
|
RequestInterface::METHOD_DELETE, |
101
|
|
|
'/', |
102
|
|
|
new AbstractCrudObject(), |
103
|
|
|
'NODE', |
104
|
|
|
array(), |
105
|
|
|
new TypeChecker($param_types, $enums) |
106
|
|
|
); |
107
|
|
|
$request->addParams($params); |
108
|
|
|
$request->addFields($fields); |
109
|
|
|
return $pending ? $request : $request->execute(); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
113
|
|
|
$this->assureId(); |
114
|
|
|
|
115
|
|
|
$param_types = array( |
116
|
|
|
); |
117
|
|
|
$enums = array( |
118
|
|
|
); |
119
|
|
|
|
120
|
|
|
$request = new ApiRequest( |
121
|
|
|
$this->api, |
122
|
|
|
$this->data['id'], |
123
|
|
|
RequestInterface::METHOD_GET, |
124
|
|
|
'/', |
125
|
|
|
new ProductSet(), |
126
|
|
|
'NODE', |
127
|
|
|
ProductSet::getFieldsEnum()->getValues(), |
128
|
|
|
new TypeChecker($param_types, $enums) |
129
|
|
|
); |
130
|
|
|
$request->addParams($params); |
131
|
|
|
$request->addFields($fields); |
132
|
|
|
return $pending ? $request : $request->execute(); |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) { |
136
|
|
|
$this->assureId(); |
137
|
|
|
|
138
|
|
|
$param_types = array( |
139
|
|
|
'filter' => 'Object', |
140
|
|
|
'name' => 'string', |
141
|
|
|
); |
142
|
|
|
$enums = array( |
143
|
|
|
); |
144
|
|
|
|
145
|
|
|
$request = new ApiRequest( |
146
|
|
|
$this->api, |
147
|
|
|
$this->data['id'], |
148
|
|
|
RequestInterface::METHOD_POST, |
149
|
|
|
'/', |
150
|
|
|
new ProductSet(), |
151
|
|
|
'NODE', |
152
|
|
|
ProductSet::getFieldsEnum()->getValues(), |
153
|
|
|
new TypeChecker($param_types, $enums) |
154
|
|
|
); |
155
|
|
|
$request->addParams($params); |
156
|
|
|
$request->addFields($fields); |
157
|
|
|
return $pending ? $request : $request->execute(); |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
} |
161
|
|
|
|