| 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\HotelFields; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |  * This class is auto-genereated. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 Hotel extends AbstractCrudObject { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |   protected function getEndpoint() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |     return 'hotels'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |    * @return HotelFields | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |    */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |   public static function getFieldsEnum() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |     return HotelFields::getInstance(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |   protected static function getReferencedEnums() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     $ref_enums = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |     return $ref_enums; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 60 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |   public function createHotelRoom(array $fields = array(), array $params = array(), $pending = false) { | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |     $this->assureId(); | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |     $param_types = array( | 
            
                                                                        
                            
            
                                    
            
            
                | 65 |  |  |       'applinks' => 'Object', | 
            
                                                                        
                            
            
                                    
            
            
                | 66 |  |  |       'base_price' => 'float', | 
            
                                                                        
                            
            
                                    
            
            
                | 67 |  |  |       'currency' => 'string', | 
            
                                                                        
                            
            
                                    
            
            
                | 68 |  |  |       'description' => 'string', | 
            
                                                                        
                            
            
                                    
            
            
                | 69 |  |  |       'images' => 'list<Object>', | 
            
                                                                        
                            
            
                                    
            
            
                | 70 |  |  |       'margin_level' => 'unsigned int', | 
            
                                                                        
                            
            
                                    
            
            
                | 71 |  |  |       'name' => 'string', | 
            
                                                                        
                            
            
                                    
            
            
                | 72 |  |  |       'pricing_variables' => 'list<Object>', | 
            
                                                                        
                            
            
                                    
            
            
                | 73 |  |  |       'room_id' => 'string', | 
            
                                                                        
                            
            
                                    
            
            
                | 74 |  |  |       'url' => 'string', | 
            
                                                                        
                            
            
                                    
            
            
                | 75 |  |  |     ); | 
            
                                                                        
                            
            
                                    
            
            
                | 76 |  |  |     $enums = array( | 
            
                                                                        
                            
            
                                    
            
            
                | 77 |  |  |     ); | 
            
                                                                        
                            
            
                                    
            
            
                | 78 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 79 |  |  |     $request = new ApiRequest( | 
            
                                                                        
                            
            
                                    
            
            
                | 80 |  |  |       $this->api, | 
            
                                                                        
                            
            
                                    
            
            
                | 81 |  |  |       $this->data['id'], | 
            
                                                                        
                            
            
                                    
            
            
                | 82 |  |  |       RequestInterface::METHOD_POST, | 
            
                                                                        
                            
            
                                    
            
            
                | 83 |  |  |       '/hotel_rooms', | 
            
                                                                        
                            
            
                                    
            
            
                | 84 |  |  |       new HotelRoom(), | 
            
                                                                        
                            
            
                                    
            
            
                | 85 |  |  |       'EDGE', | 
            
                                                                        
                            
            
                                    
            
            
                | 86 |  |  |       HotelRoom::getFieldsEnum()->getValues(), | 
            
                                                                        
                            
            
                                    
            
            
                | 87 |  |  |       new TypeChecker($param_types, $enums) | 
            
                                                                        
                            
            
                                    
            
            
                | 88 |  |  |     ); | 
            
                                                                        
                            
            
                                    
            
            
                | 89 |  |  |     $request->addParams($params); | 
            
                                                                        
                            
            
                                    
            
            
                | 90 |  |  |     $request->addFields($fields); | 
            
                                                                        
                            
            
                                    
            
            
                | 91 |  |  |     return $pending ? $request : $request->execute(); | 
            
                                                                        
                            
            
                                    
            
            
                | 92 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |   public function getSelf(array $fields = array(), array $params = array(), $pending = false) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |     $this->assureId(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |     $param_types = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |     ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |     $enums = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |     ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |     $request = new ApiRequest( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |       $this->api, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |       $this->data['id'], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |       RequestInterface::METHOD_GET, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |       '/', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |       new Hotel(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |       'NODE', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |       Hotel::getFieldsEnum()->getValues(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |       new TypeChecker($param_types, $enums) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |     ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |     $request->addParams($params); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |     $request->addFields($fields); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |     return $pending ? $request : $request->execute(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 117 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 118 |  |  |  |