charitable
/
vendor
/
square
/
square
/
src
/
Catalog
/
Requests
/
BatchGetCatalogObjectsRequest.php
BatchGetCatalogObjectsRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Catalog/Requests/BatchGetCatalogObjectsRequest.php
| 1 | <?php |
| 2 | |
| 3 | namespace Square\Catalog\Requests; |
| 4 | |
| 5 | use Square\Core\Json\JsonSerializableType; |
| 6 | use Square\Core\Json\JsonProperty; |
| 7 | use Square\Core\Types\ArrayType; |
| 8 | |
| 9 | class BatchGetCatalogObjectsRequest extends JsonSerializableType |
| 10 | { |
| 11 | /** |
| 12 | * @var array<string> $objectIds The IDs of the CatalogObjects to be retrieved. |
| 13 | */ |
| 14 | #[JsonProperty('object_ids'), ArrayType(['string'])] |
| 15 | private array $objectIds; |
| 16 | |
| 17 | /** |
| 18 | * If `true`, the response will include additional objects that are related to the |
| 19 | * requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field |
| 20 | * of the response. These objects are put in the `related_objects` field. Setting this to `true` is |
| 21 | * helpful when the objects are needed for immediate display to a user. |
| 22 | * This process only goes one level deep. Objects referenced by the related objects will not be included. For example, |
| 23 | * |
| 24 | * if the `objects` field of the response contains a CatalogItem, its associated |
| 25 | * CatalogCategory objects, CatalogTax objects, CatalogImage objects and |
| 26 | * CatalogModifierLists will be returned in the `related_objects` field of the |
| 27 | * response. If the `objects` field of the response contains a CatalogItemVariation, |
| 28 | * its parent CatalogItem will be returned in the `related_objects` field of |
| 29 | * the response. |
| 30 | * |
| 31 | * Default value: `false` |
| 32 | * |
| 33 | * @var ?bool $includeRelatedObjects |
| 34 | */ |
| 35 | #[JsonProperty('include_related_objects')] |
| 36 | private ?bool $includeRelatedObjects; |
| 37 | |
| 38 | /** |
| 39 | * The specific version of the catalog objects to be included in the response. |
| 40 | * This allows you to retrieve historical versions of objects. The specified version value is matched against |
| 41 | * the [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will |
| 42 | * be from the current version of the catalog. |
| 43 | * |
| 44 | * @var ?int $catalogVersion |
| 45 | */ |
| 46 | #[JsonProperty('catalog_version')] |
| 47 | private ?int $catalogVersion; |
| 48 | |
| 49 | /** |
| 50 | * @var ?bool $includeDeletedObjects Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. |
| 51 | */ |
| 52 | #[JsonProperty('include_deleted_objects')] |
| 53 | private ?bool $includeDeletedObjects; |
| 54 | |
| 55 | /** |
| 56 | * Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists |
| 57 | * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category |
| 58 | * and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned |
| 59 | * in the response payload. |
| 60 | * |
| 61 | * @var ?bool $includeCategoryPathToRoot |
| 62 | */ |
| 63 | #[JsonProperty('include_category_path_to_root')] |
| 64 | private ?bool $includeCategoryPathToRoot; |
| 65 | |
| 66 | /** |
| 67 | * @param array{ |
| 68 | * objectIds: array<string>, |
| 69 | * includeRelatedObjects?: ?bool, |
| 70 | * catalogVersion?: ?int, |
| 71 | * includeDeletedObjects?: ?bool, |
| 72 | * includeCategoryPathToRoot?: ?bool, |
| 73 | * } $values |
| 74 | */ |
| 75 | public function __construct( |
| 76 | array $values, |
| 77 | ) { |
| 78 | $this->objectIds = $values['objectIds']; |
| 79 | $this->includeRelatedObjects = $values['includeRelatedObjects'] ?? null; |
| 80 | $this->catalogVersion = $values['catalogVersion'] ?? null; |
| 81 | $this->includeDeletedObjects = $values['includeDeletedObjects'] ?? null; |
| 82 | $this->includeCategoryPathToRoot = $values['includeCategoryPathToRoot'] ?? null; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * @return array<string> |
| 87 | */ |
| 88 | public function getObjectIds(): array |
| 89 | { |
| 90 | return $this->objectIds; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * @param array<string> $value |
| 95 | */ |
| 96 | public function setObjectIds(array $value): self |
| 97 | { |
| 98 | $this->objectIds = $value; |
| 99 | return $this; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * @return ?bool |
| 104 | */ |
| 105 | public function getIncludeRelatedObjects(): ?bool |
| 106 | { |
| 107 | return $this->includeRelatedObjects; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * @param ?bool $value |
| 112 | */ |
| 113 | public function setIncludeRelatedObjects(?bool $value = null): self |
| 114 | { |
| 115 | $this->includeRelatedObjects = $value; |
| 116 | return $this; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * @return ?int |
| 121 | */ |
| 122 | public function getCatalogVersion(): ?int |
| 123 | { |
| 124 | return $this->catalogVersion; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * @param ?int $value |
| 129 | */ |
| 130 | public function setCatalogVersion(?int $value = null): self |
| 131 | { |
| 132 | $this->catalogVersion = $value; |
| 133 | return $this; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * @return ?bool |
| 138 | */ |
| 139 | public function getIncludeDeletedObjects(): ?bool |
| 140 | { |
| 141 | return $this->includeDeletedObjects; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * @param ?bool $value |
| 146 | */ |
| 147 | public function setIncludeDeletedObjects(?bool $value = null): self |
| 148 | { |
| 149 | $this->includeDeletedObjects = $value; |
| 150 | return $this; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * @return ?bool |
| 155 | */ |
| 156 | public function getIncludeCategoryPathToRoot(): ?bool |
| 157 | { |
| 158 | return $this->includeCategoryPathToRoot; |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * @param ?bool $value |
| 163 | */ |
| 164 | public function setIncludeCategoryPathToRoot(?bool $value = null): self |
| 165 | { |
| 166 | $this->includeCategoryPathToRoot = $value; |
| 167 | return $this; |
| 168 | } |
| 169 | } |
| 170 |