Completed
Push — master ( 86d4f9...53bee2 )
by
unknown
04:49
created

HotelRoom::getEndpoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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\HotelRoomFields;
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 HotelRoom extends AbstractCrudObject {
43
44
  protected function getEndpoint() {
45
    return 'hotel_rooms';
46
  }
47
48
  /**
49
   * @return HotelRoomFields
50
   */
51
  public static function getFieldsEnum() {
52
    return HotelRoomFields::getInstance();
53
  }
54
55
  protected static function getReferencedEnums() {
56
    $ref_enums = array();
57
    return $ref_enums;
58
  }
59
60
61
  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {
62
    $this->assureId();
63
64
    $param_types = array(
65
    );
66
    $enums = array(
67
    );
68
69
    $request = new ApiRequest(
70
      $this->api,
71
      $this->data['id'],
72
      RequestInterface::METHOD_DELETE,
73
      '/',
74
      new AbstractCrudObject(),
75
      'NODE',
76
      array(),
77
      new TypeChecker($param_types, $enums)
78
    );
79
    $request->addParams($params);
80
    $request->addFields($fields);
81
    return $pending ? $request : $request->execute();
82
  }
83
84
  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
85
    $this->assureId();
86
87
    $param_types = array(
88
    );
89
    $enums = array(
90
    );
91
92
    $request = new ApiRequest(
93
      $this->api,
94
      $this->data['id'],
95
      RequestInterface::METHOD_GET,
96
      '/',
97
      new HotelRoom(),
98
      'NODE',
99
      HotelRoom::getFieldsEnum()->getValues(),
100
      new TypeChecker($param_types, $enums)
101
    );
102
    $request->addParams($params);
103
    $request->addFields($fields);
104
    return $pending ? $request : $request->execute();
105
  }
106
107
  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
108
    $this->assureId();
109
110
    $param_types = array(
111
      'applinks' => 'Object',
112
      'base_price' => 'float',
113
      'currency' => 'string',
114
      'description' => 'string',
115
      'images' => 'list<Object>',
116
      'margin_level' => 'unsigned int',
117
      'name' => 'string',
118
      'pricing_variables' => 'list<Object>',
119
      'url' => 'string',
120
    );
121
    $enums = array(
122
    );
123
124
    $request = new ApiRequest(
125
      $this->api,
126
      $this->data['id'],
127
      RequestInterface::METHOD_POST,
128
      '/',
129
      new HotelRoom(),
130
      'NODE',
131
      HotelRoom::getFieldsEnum()->getValues(),
132
      new TypeChecker($param_types, $enums)
133
    );
134
    $request->addParams($params);
135
    $request->addFields($fields);
136
    return $pending ? $request : $request->execute();
137
  }
138
139
}
140