1616 */
1717class Service extends AbstractService
1818{
19+ /**
20+ * Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\ResourceType type in a generator format.
21+ *
22+ * @return \Generator
23+ */
1924 public function listResourceTypes (): \Generator
2025 {
2126 return $ this ->model (ResourceType::class)->enumerate ($ this ->api ->getResourceTypes (), []);
2227 }
2328
29+ /**
30+ * Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\Resource type in a generator format.
31+ *
32+ * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResources}
33+ *
34+ * @return \Generator
35+ */
2436 public function listResources (array $ options = []): \Generator
2537 {
2638 $ this ->injectGenericType ($ options );
@@ -29,20 +41,31 @@ public function listResources(array $options = []): \Generator
2941 }
3042
3143 /**
44+ * Retrieves a Resource object and populates its unique identifier object. This operation will not perform a GET or
45+ * HEAD request by default; you will need to call retrieve() if you want to pull in remote state from the API.
46+ *
3247 * @param array $options
3348 *
34- * @return \OpenStack\Metric\v1\Gnocchi\Models\ Resource
49+ * @return Resource
3550 */
36- public function getResource (array $ options = []): \ OpenStack \ Metric \ v1 \ Gnocchi \ Models \ Resource
51+ public function getResource (array $ options = []): Resource
3752 {
3853 $ this ->injectGenericType ($ options );
3954
55+ /** @var Resource $resource */
4056 $ resource = $ this ->model (Resource::class);
4157 $ resource ->populateFromArray ($ options );
4258
4359 return $ resource ;
4460 }
4561
62+ /**
63+ * Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\Resource type in a generator format.
64+ *
65+ * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::searchResources}
66+ *
67+ * @return \Generator
68+ */
4669 public function searchResources (array $ options = []): \Generator
4770 {
4871 $ this ->injectGenericType ($ options );
@@ -64,19 +87,41 @@ public function searchResources(array $options = []): \Generator
6487 return $ this ->model (Resource::class)->enumerate ($ this ->api ->searchResources (), $ options );
6588 }
6689
67- public function getMetric ($ id ): Metric
90+ /**
91+ * Retrieves a Metric object and populates its unique identifier object. This operation will not perform a GET or
92+ * HEAD request by default; you will need to call retrieve() if you want to pull in remote state from the API.
93+ *
94+ * @param string $id
95+ *
96+ * @return Metric
97+ */
98+ public function getMetric (string $ id ): Metric
6899 {
100+ /** @var Metric $metric */
69101 $ metric = $ this ->model (Metric::class);
70102 $ metric ->populateFromArray (['id ' => $ id ]);
71103
72104 return $ metric ;
73105 }
74106
107+ /**
108+ * Retrieves a collection of Metric type in a generator format.
109+ *
110+ * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getMetrics}
111+ *
112+ * @return \Generator
113+ */
75114 public function listMetrics (array $ options = []): \Generator
76115 {
77116 return $ this ->model (Metric::class)->enumerate ($ this ->api ->getMetrics (), $ options );
78117 }
79118
119+ /**
120+ * If options does not have type, this will inject $options['type'] = 'generic'
121+ *
122+ * @internal
123+ * @param array $options
124+ */
80125 private function injectGenericType (array &$ options )
81126 {
82127 if (empty ($ options ) || !isset ($ options ['type ' ])) {
0 commit comments